Rewrite standart Exception for just return error. Old functionality of showing statical pages was splitted for two new exceptions: StaticPageException for showing static templates and DynamicPageException for invoking Actions classes
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@30 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -26,12 +26,18 @@ final class PageController
|
||||
return $decorator->display($action);
|
||||
} catch (MJException $e) {
|
||||
return $e->terminate();
|
||||
} catch (Exception $e) {
|
||||
} catch (DynamicPageException $e) {
|
||||
$decorator_name = DEFAULT_DECORATOR;
|
||||
$action_name = DEFAULT_ACTION;
|
||||
|
||||
$decorator = new $decorator_name;
|
||||
$action_name = $e->getMessage();
|
||||
return $decorator->display(new $action_name);
|
||||
} catch (StaticPageException $e) {
|
||||
$decorator_name = DEFAULT_DECORATOR;
|
||||
$decorator = new $decorator_name;
|
||||
$action_name = DEFAULT_ACTION;
|
||||
return $decorator->display(new $action_name($e->getMessage()));
|
||||
} catch (Exception $e) {
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user