In debug mode uncaught exceptions should display a nice page

This commit is contained in:
Bart Visscher 2013-07-21 22:40:35 +02:00
parent 8c5df31c49
commit aa22194a09
1 changed files with 7 additions and 3 deletions

View File

@ -422,10 +422,14 @@ class OC {
} }
} }
if (!defined('PHPUNIT_RUN') and !(defined('DEBUG') and DEBUG)) { if (!defined('PHPUNIT_RUN')) {
if (defined('DEBUG') and DEBUG) {
set_exception_handler(array('OC_Template', 'printExceptionErrorPage'));
} else {
OC\Log\ErrorHandler::register(); OC\Log\ErrorHandler::register();
OC\Log\ErrorHandler::setLogger(OC_Log::$object); OC\Log\ErrorHandler::setLogger(OC_Log::$object);
} }
}
// register the stream wrappers // register the stream wrappers
stream_wrapper_register('fakedir', 'OC\Files\Stream\Dir'); stream_wrapper_register('fakedir', 'OC\Files\Stream\Dir');