database errors handling
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@51 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -17,7 +17,7 @@ class MJException extends Exception
|
|||||||
public function terminate()
|
public function terminate()
|
||||||
{
|
{
|
||||||
if (!DEBUG_ENABLE) {
|
if (!DEBUG_ENABLE) {
|
||||||
return "Sorry, server temporary unavaible";
|
throw new StaticPageException(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
$return = "<b>MJ Error:</b> ";
|
$return = "<b>MJ Error:</b> ";
|
||||||
|
@ -20,12 +20,14 @@ final class PageController
|
|||||||
public function display()
|
public function display()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->route = Load::router()->proccess(MJ_PATH);
|
try{
|
||||||
$action = new $this->route->action;
|
$this->route = Load::router()->proccess(MJ_PATH);
|
||||||
$decorator = new $this->route->decorator;
|
$action = new $this->route->action;
|
||||||
return $decorator->display($action);
|
$decorator = new $this->route->decorator;
|
||||||
} catch (MJException $e) {
|
return $decorator->display($action);
|
||||||
return $e->terminate();
|
} catch (MJException $e) {
|
||||||
|
return $e->terminate();
|
||||||
|
}
|
||||||
} catch (DynamicPageException $e) {
|
} catch (DynamicPageException $e) {
|
||||||
$decorator_name = DEFAULT_DECORATOR;
|
$decorator_name = DEFAULT_DECORATOR;
|
||||||
$decorator = new $decorator_name;
|
$decorator = new $decorator_name;
|
||||||
|
Reference in New Issue
Block a user