Skip to content

Commit

Permalink
Change configuration property to static class property
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsteinsland committed Jan 16, 2015
1 parent a5e1be7 commit e37db25
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/Cake/Error/ErrorHandler.php
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit e37db25

Please sign in to comment.