From 842159189e7908e2da8f9db7e286f88737a32a61 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Fri, 22 Jan 2010 09:11:55 +0000 Subject: [PATCH] _include: Make the generic exception handler handle errors. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2123 44740490-163a-0410-bde0-09ae8108e29a --- www/_include.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/www/_include.php b/www/_include.php index cb202504c..927a8d791 100644 --- a/www/_include.php +++ b/www/_include.php @@ -27,8 +27,13 @@ SimpleSAML_Error_Assertion::installHandler(); /* Show error page on unhandled exceptions. */ function SimpleSAML_exception_handler(Exception $exception) { - $e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $exception); - $e->show(); + + if ($exception instanceof SimpleSAML_Error_Error) { + $exception->show(); + } else { + $e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $exception); + $e->show(); + } } set_exception_handler('SimpleSAML_exception_handler'); -- GitLab