Backport of e09c704
authorAlexander Ebert <ebert@woltlab.com>
Mon, 31 Aug 2015 12:18:32 +0000 (14:18 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 31 Aug 2015 12:18:32 +0000 (14:18 +0200)
wcfsetup/install/files/lib/system/WCF.class.php

index e423c5c3552b34da7f2e831be8cf5aa1156865eb..ef059e8f2de793a13f36db5b2a42f4665fdaca0a 100644 (file)
@@ -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("<pre>WCF::handleException() Unhandled exception: ".$exception->getMessage()."\n\n".$exception->getTraceAsString());
+               }
                catch (\Exception $exception) {
                        die("<pre>WCF::handleException() Unhandled exception: ".$exception->getMessage()."\n\n".$exception->getTraceAsString());
                }