From: Tim Düsterhus Date: Thu, 6 Aug 2015 16:31:49 +0000 (+0200) Subject: Add basic compatibility w/ PHP 7 Exception hierarchie X-Git-Tag: 2.1.7~40 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e09c7044b7be1c01c5addf2aed8f2b8e4106b148;p=GitHub%2FWoltLab%2FWCF.git Add basic compatibility w/ PHP 7 Exception hierarchie --- 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());
 		}