diff --git a/route.php b/route.php index 12160b2..41ce1d2 100644 --- a/route.php +++ b/route.php @@ -530,7 +530,17 @@ class route { if ($this->debug) echo "==> FOUND EQUAL !\n"; - $function (); + try + { + $function (); + } + catch (Exception $e) + { + header ($_SERVER["SERVER_PROTOCOL"]." 500 Internal Server Error"); + // TODO : Allow a specific page to be configured and displayed + echo "

Internal server error

"; + echo $e->getMessage(); + } exit; } @@ -556,7 +566,18 @@ class route else $params[] = null; } - call_user_func_array ($function, $params); + + try + { + call_user_func_array ($function, $params); + } + catch (Exception $e) + { + header ($_SERVER["SERVER_PROTOCOL"]." 500 Internal Server Error"); + // TODO : Allow a specific page to be configured and displayed + echo "

Internal server error

"; + echo $e->getMessage(); + } exit; }