diff options
author | Kevin Chabowski <kevin@kch42.de> | 2012-01-21 21:43:49 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2012-01-21 21:43:49 +0100 |
commit | eaabdafbcbad712a82878c8a08e0b8b097cae2be (patch) | |
tree | 52ab06957710a67d4860e8ea845c3ca52b413e00 /ratatoeskr | |
parent | f8ef06afe05d6a3c2a98f9134ba1f554c0fa5c19 (diff) | |
download | ratatoeskr-cms-eaabdafbcbad712a82878c8a08e0b8b097cae2be.tar.gz ratatoeskr-cms-eaabdafbcbad712a82878c8a08e0b8b097cae2be.tar.bz2 ratatoeskr-cms-eaabdafbcbad712a82878c8a08e0b8b097cae2be.zip |
Catching uncatched errors and give error page.
Error details only if __DEBUG__ is True.
Diffstat (limited to 'ratatoeskr')
-rw-r--r-- | ratatoeskr/main.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ratatoeskr/main.php b/ratatoeskr/main.php index d40d911..1e5445a 100644 --- a/ratatoeskr/main.php +++ b/ratatoeskr/main.php @@ -22,6 +22,23 @@ $plugin_objs = array(); function ratatoeskr() { + global $ste; + try + { + _ratatoeskr(); + } + catch(Exception $e) + { + header("HTTP/1.1 500 Internal Server Error"); + $ste->vars["title"] = "500 Internal Server Error"; + if(__DEBUG__) + $ste->vars["details"] = $e->__toString(); + echo $ste->exectemplate("/systemtemplates/error.html"); + } +} + +function _ratatoeskr() +{ global $backend_subactions, $ste, $url_handlers, $ratatoeskr_settings, $plugin_objs; $ts_start = microtime(True); |