Skip to content

Commit

Permalink
FIX Only suppress fatal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamish Friedlander committed Jul 22, 2013
1 parent 604d9bf commit 84011aa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions core/startup/ErrorControlChain.php
Expand Up @@ -18,6 +18,8 @@
* It will likely be heavily refactored before the release of 3.2
*/
class ErrorControlChain {
public static $fatal_errors = null; // Initialised after class definition

protected $error = false;
protected $steps = array();

Expand Down Expand Up @@ -67,8 +69,12 @@ public function thenAlways($callback) {
}

public function handleError($errno, $errstr) {
if ((error_reporting() & $errno) == $errno && $this->suppression) throw new Exception('Generic Error');
else return false;
if ((error_reporting() & self::$fatal_errors & $errno) != 0 && $this->suppression) {
throw new Exception('Generic Error');
}
else {
return false;
}
}

protected function lastErrorWasFatal() {
Expand Down Expand Up @@ -117,3 +123,6 @@ protected function step() {
}
}
}

ErrorControlChain::$fatal_errors = E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR;
if (defined('E_RECOVERABLE_ERROR')) ErrorControlChain::$fatal_errors |= E_RECOVERABLE_ERROR;

0 comments on commit 84011aa

Please sign in to comment.