From fabbad8a1b0e4631a6b114767da06efacb348596 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 4 Nov 2011 15:15:10 +0100 Subject: [PATCH] Fixed exception handling in debug mode --- .../lib/system/exception/LoggedException.class.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/lib/system/exception/LoggedException.class.php b/wcfsetup/install/files/lib/system/exception/LoggedException.class.php index 2b332ab4ba..ba30ae9fda 100644 --- a/wcfsetup/install/files/lib/system/exception/LoggedException.class.php +++ b/wcfsetup/install/files/lib/system/exception/LoggedException.class.php @@ -14,18 +14,16 @@ namespace wcf\system\exception; */ class LoggedException extends \Exception { /** - * Surpresses the original error message, you can bypass this - * by setting $raw to true. + * Surpresses the original error message. * - * @param boolean $raw * @see \Exception::getMessage() */ - public function _getMessage($raw = false) { - if ($raw) { - return $this->getMessage(); + public function _getMessage() { + if (DEBUG_MODE == 'production') { + return 'An error occured. Sorry.'; } - return 'An error occured. Sorry.'; + return $this->getMessage(); } /** @@ -49,7 +47,7 @@ class LoggedException extends \Exception { } // build message - $message = date('r', TIME_NOW) . "\n" . $this->getMessage(true) . "\n\n" . $this->getTraceAsString() . "\n\n\n"; + $message = date('r', TIME_NOW) . "\n" . $this->getMessage() . "\n\n" . $this->getTraceAsString() . "\n\n\n"; // append @file_put_contents($logFile, $message, FILE_APPEND); -- 2.20.1