Change configuration property to static class property

This commit is contained in:
David Steinsland 2015-01-16 14:47:44 +01:00
parent a5e1be7abf
commit e37db25ce0

View file

@ -95,6 +95,14 @@ App::uses('Router', 'Routing');
*/
class ErrorHandler {
/**
* Whether to give up rendering an exception, if the renderer itself is
* throwing exceptions.
*
* @var bool
*/
protected static $_bailExceptionRendering = false;
/**
* Set as the default exception handler by the CakePHP bootstrap process.
*
@ -126,7 +134,7 @@ class ErrorHandler {
$e->getTraceAsString()
);
Configure::write('Exception.bail', true);
static::$_bailExceptionRendering = true;
trigger_error($message, E_USER_ERROR);
}
}
@ -258,8 +266,8 @@ class ErrorHandler {
$exception = new InternalErrorException();
}
if (Configure::read('Exception.bail')) {
Configure::write('Exception.bail', false);
if (static::$_bailExceptionRendering) {
static::$_bailExceptionRendering = false;
throw $exception;
}