From: Alexander Ebert Date: Fri, 18 Nov 2016 10:50:03 +0000 (+0100) Subject: Fixed exception output during WCFSetup X-Git-Tag: 3.0.0_Beta_5~30 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3353ca3e73b5ffe04b8bdb0fc148fe05f2cdf6ce;p=GitHub%2FWoltLab%2FWCF.git Fixed exception output during WCFSetup --- diff --git a/wcfsetup/install.php b/wcfsetup/install.php index 1b32b3b20b..e5f37d8c08 100644 --- a/wcfsetup/install.php +++ b/wcfsetup/install.php @@ -64,9 +64,10 @@ class SystemException extends \Exception implements IPrintableException { * @param string $message error message * @param integer $code error code * @param string $description description of the error + * @param \Exception $previous repacked Exception */ - public function __construct($message = '', $code = 0, $description = '') { - parent::__construct($message, $code); + public function __construct($message = '', $code = 0, $description = '', \Exception $previous = null) { + parent::__construct((string) $message, (int) $code, $previous); $this->description = $description; } @@ -327,39 +328,46 @@ class SystemException extends \Exception implements IPrintableException { getTrace(); + if (isset($trace[0]['function']) && $trace[0]['function'] === 'handleException') { + // ignore repacked exception + continue; + } + ?>
-

getPrevious() && !$first) { echo "Original "; } else if ($this->getPrevious() && $first) { echo "Final "; } ?>Error

- getDescription()) { ?> -

getDescription(); ?>

+

getPrevious() && !$first) { echo "Original "; } else if ($e->getPrevious() && $first) { echo "Final "; } ?>Error

+ getDescription()) { ?> +

getDescription(); ?>

getPrevious()); + } while ($e = $e->getPrevious()); + ?> ?> @@ -448,6 +457,10 @@ function handleException($e) { $e->show(); exit; } + + // repacking + (new SystemException($e->getMessage(), $e->getCode(), '', $e))->show(); + exit; } catch (\Throwable $exception) { die("
WCF::handleException() Unhandled exception: ".$exception->getMessage()."\n\n".$exception->getTraceAsString());