From e09c7044b7be1c01c5addf2aed8f2b8e4106b148 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 6 Aug 2015 18:31:49 +0200 Subject: [PATCH] Add basic compatibility w/ PHP 7 Exception hierarchie --- wcfsetup/install/files/lib/system/WCF.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index daadb77e8c..a25d44ae90 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -268,8 +268,10 @@ class WCF { * * @param \Exception $e */ - public static final function handleException(\Exception $e) { + public static final function handleException($e) { try { + if (!($e instanceof \Exception)) throw $e; + if ($e instanceof IPrintableException) { $e->show(); exit; @@ -278,6 +280,9 @@ class WCF { // repack Exception self::handleException(new SystemException($e->getMessage(), $e->getCode(), '', $e)); } + catch (\Throwable $exception) { + die("
WCF::handleException() Unhandled exception: ".$exception->getMessage()."\n\n".$exception->getTraceAsString());
+		}
 		catch (\Exception $exception) {
 			die("
WCF::handleException() Unhandled exception: ".$exception->getMessage()."\n\n".$exception->getTraceAsString());
 		}
-- 
2.20.1