From eaabdafbcbad712a82878c8a08e0b8b097cae2be Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Sat, 21 Jan 2012 21:43:49 +0100 Subject: Catching uncatched errors and give error page. Error details only if __DEBUG__ is True. --- ratatoeskr/main.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'ratatoeskr/main.php') diff --git a/ratatoeskr/main.php b/ratatoeskr/main.php index d40d911..1e5445a 100644 --- a/ratatoeskr/main.php +++ b/ratatoeskr/main.php @@ -21,6 +21,23 @@ require_once(dirname(__FILE__) . "/backend.php"); $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; -- cgit v1.2.3-70-g09d2