- $page->assign('platal', $this);
- switch ($this->call_hook($page)) {
- case PL_FORBIDDEN:
- $this->mods['core']->handler_403($page);
- break;
+ try {
+ $page->assign('platal', $this);
+ switch ($this->call_hook($page)) {
+ case PL_FORBIDDEN:
+ $this->mods['core']->handler_403($page);
+ break;
+
+ case PL_NOT_FOUND:
+ $this->mods['core']->handler_404($page);
+ break;
+
+ case PL_WIKI:
+ return PL_WIKI;
+ }
+ } catch (Exception $e) {
+ header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');