diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 11 | ||||
-rw-r--r-- | lib/private/log/errorhandler.php | 3 |
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/base.php b/lib/base.php index 26be1161ba3..8ea164a5007 100644 --- a/lib/base.php +++ b/lib/base.php @@ -545,14 +545,9 @@ class OC { OC_Util::isSetLocaleWorking(); if (!defined('PHPUNIT_RUN')) { - $logger = \OC::$server->getLogger(); - OC\Log\ErrorHandler::setLogger($logger); - if (\OC::$server->getConfig()->getSystemValue('debug', false)) { - OC\Log\ErrorHandler::register(true); - set_exception_handler(array('OC_Template', 'printExceptionErrorPage')); - } else { - OC\Log\ErrorHandler::register(); - } + OC\Log\ErrorHandler::setLogger(\OC::$server->getLogger()); + $debug = \OC::$server->getConfig()->getSystemValue('debug', false); + OC\Log\ErrorHandler::register($debug); } // register the stream wrappers diff --git a/lib/private/log/errorhandler.php b/lib/private/log/errorhandler.php index 27cde4aa242..8899bcfcb03 100644 --- a/lib/private/log/errorhandler.php +++ b/lib/private/log/errorhandler.php @@ -44,6 +44,9 @@ class ErrorHandler { if ($debug) { set_error_handler(array($handler, 'onAll'), E_ALL); + if (\OC::$CLI) { + set_exception_handler(array('OC_Template', 'printExceptionErrorPage')); + } } else { set_error_handler(array($handler, 'onError')); } |