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 { 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. * Set as the default exception handler by the CakePHP bootstrap process.
* *
@ -126,7 +134,7 @@ class ErrorHandler {
$e->getTraceAsString() $e->getTraceAsString()
); );
Configure::write('Exception.bail', true); static::$_bailExceptionRendering = true;
trigger_error($message, E_USER_ERROR); trigger_error($message, E_USER_ERROR);
} }
} }
@ -258,8 +266,8 @@ class ErrorHandler {
$exception = new InternalErrorException(); $exception = new InternalErrorException();
} }
if (Configure::read('Exception.bail')) { if (static::$_bailExceptionRendering) {
Configure::write('Exception.bail', false); static::$_bailExceptionRendering = false;
throw $exception; throw $exception;
} }