From e37db25ce0ece51a63a76a26ef08ad6781ca88dc Mon Sep 17 00:00:00 2001 From: David Steinsland Date: Fri, 16 Jan 2015 14:47:44 +0100 Subject: [PATCH] Change configuration property to static class property --- lib/Cake/Error/ErrorHandler.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php index 33a7e764e36..e89574a85c8 100644 --- a/lib/Cake/Error/ErrorHandler.php +++ b/lib/Cake/Error/ErrorHandler.php @@ -95,6 +95,14 @@ */ 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 @@ public static function handleException(Exception $exception) { $e->getTraceAsString() ); - Configure::write('Exception.bail', true); + static::$_bailExceptionRendering = true; trigger_error($message, E_USER_ERROR); } } @@ -258,8 +266,8 @@ public static function handleFatalError($code, $description, $file, $line) { $exception = new InternalErrorException(); } - if (Configure::read('Exception.bail')) { - Configure::write('Exception.bail', false); + if (static::$_bailExceptionRendering) { + static::$_bailExceptionRendering = false; throw $exception; }