diff --git a/classes/MJException.class.php b/classes/MJException.class.php index 8735261..4964b4f 100644 --- a/classes/MJException.class.php +++ b/classes/MJException.class.php @@ -17,7 +17,7 @@ class MJException extends Exception public function terminate() { if (!DEBUG_ENABLE) { - return "Sorry, server temporary unavaible"; + throw new StaticPageException(500); } $return = "MJ Error: "; diff --git a/classes/PageController.class.php b/classes/PageController.class.php index 2a53901..3784bac 100644 --- a/classes/PageController.class.php +++ b/classes/PageController.class.php @@ -20,12 +20,14 @@ final class PageController public function display() { try { - $this->route = Load::router()->proccess(MJ_PATH); - $action = new $this->route->action; - $decorator = new $this->route->decorator; - return $decorator->display($action); - } catch (MJException $e) { - return $e->terminate(); + try{ + $this->route = Load::router()->proccess(MJ_PATH); + $action = new $this->route->action; + $decorator = new $this->route->decorator; + return $decorator->display($action); + } catch (MJException $e) { + return $e->terminate(); + } } catch (DynamicPageException $e) { $decorator_name = DEFAULT_DECORATOR; $decorator = new $decorator_name;