correct namespaces

This commit is contained in:
coderkun 2013-08-27 14:24:31 +02:00
commit 30045f8832
3 changed files with 17 additions and 13 deletions

View file

@ -116,17 +116,20 @@
try { try {
return $this->_run($request, $response); return $this->_run($request, $response);
} }
catch(ParamsNotValidException $e) { catch(\nre\exceptions\AccessDeniedException $e) {
$this->error($e, WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN); $this->error($e, \nre\core\WebUtils::HTTP_FORBIDDEN, self::STAGE_RUN);
} }
catch(IdNotFoundException $e) { catch(\nre\exceptions\ParamsNotValidException $e) {
$this->error($e, WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN); $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN);
} }
catch(DatamodelException $e) { catch(\nre\exceptions\IdNotFoundException $e) {
$this->error($e, WebUtils::HTTP_SERVICE_UNAVAILABLE, self::STAGE_RUN); $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN);
} }
catch(ActionNotFoundException $e) { catch(\nre\exceptions\DatamodelException $e) {
$this->error($e, WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN); $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE, self::STAGE_RUN);
}
catch(\nre\exceptions\ActionNotFoundException $e) {
$this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN);
} }
} }
@ -173,8 +176,8 @@
func_get_args() func_get_args()
); );
} }
catch(DatamodelException $e) { catch(\nre\exceptions\DatamodelException $e) {
throw new FatalDatamodelException($e->getDatamodelMessage(), $e->getDatamodelErrorNumber()); throw new \nre\exceptions\FatalDatamodelException($e->getDatamodelMessage(), $e->getDatamodelErrorNumber());
} }
} }

View file

@ -60,7 +60,7 @@
$this->errorService($e); $this->errorService($e);
} }
catch(\nre\exceptions\ActionNotFoundException $e) { catch(\nre\exceptions\ActionNotFoundException $e) {
$this->error($e, WebUtils::HTTP_NOT_FOUND); $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND);
} }
catch(\nre\exceptions\FatalDatamodelException $e) { catch(\nre\exceptions\FatalDatamodelException $e) {
$this->errorService($e); $this->errorService($e);

View file

@ -74,7 +74,7 @@
*/ */
private static function getClassName($modelName) private static function getClassName($modelName)
{ {
$className = \nre\core\ClassLoader::concatClassNames($modelName, \nre\core\ClassLoader::stripNamespace(get_class())); $className = ClassLoader::concatClassNames($modelName, ClassLoader::stripNamespace(get_class()));
return \nre\configs\AppConfig::$app['namespace']."models\\$className"; return \nre\configs\AppConfig::$app['namespace']."models\\$className";
@ -131,7 +131,8 @@
Model::load($model); Model::load($model);
// Construct Model // Construct Model
$this->$model = Model::factory($model); $modelName = ucfirst(strtolower($model));
$this->$modelName = Model::factory($model);
} }
} }