mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Only suppress fatal errors
This commit is contained in:
parent
122a9f898e
commit
09db9a659e
@ -18,6 +18,8 @@
|
|||||||
* It will likely be heavily refactored before the release of 3.2
|
* It will likely be heavily refactored before the release of 3.2
|
||||||
*/
|
*/
|
||||||
class ErrorControlChain {
|
class ErrorControlChain {
|
||||||
|
public static $fatal_errors = null; // Initialised after class definition
|
||||||
|
|
||||||
protected $error = false;
|
protected $error = false;
|
||||||
protected $steps = array();
|
protected $steps = array();
|
||||||
|
|
||||||
@ -67,8 +69,12 @@ class ErrorControlChain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function handleError($errno, $errstr) {
|
public function handleError($errno, $errstr) {
|
||||||
if ((error_reporting() & $errno) == $errno && $this->suppression) throw new Exception('Generic Error');
|
if ((error_reporting() & self::$fatal_errors & $errno) != 0 && $this->suppression) {
|
||||||
else return false;
|
throw new Exception('Generic Error');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function lastErrorWasFatal() {
|
protected function lastErrorWasFatal() {
|
||||||
@ -117,3 +123,6 @@ class ErrorControlChain {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user