ErrorControlChain
class ErrorControlChain
Class ErrorControlChain
Runs a set of steps, optionally suppressing uncaught errors or exceptions which would otherwise be fatal that occur in each step. If an error does occur, subsequent steps are normally skipped, but can optionally be run anyway.
Usage:
$chain = new ErrorControlChain(); $chain->then($callback1)->then($callback2)->thenIfErrored($callback3)->execute();
WARNING: This class is experimental and designed specifically for use pre-startup in main.php It will likely be heavily refactored before the release of 3.2
Properties
static | $fatal_errors | ||
static | $transtable |
Methods
Determine if an error has been found
No description
Sets whether errors are suppressed or not Notes: - Errors cannot be suppressed if not handling errors.
Add this callback to the chain of callbacks to call along with the state that $error must be in this point in the chain for the callback to be called
Request that the callback is invoked if not errored
Request that the callback is invoked on error
Request that the callback is invoked always
No description
No description
Details
at line 62
bool
hasErrored()
Determine if an error has been found
at line 66
setErrored($error)
at line 78
setSuppression(bool $suppression)
Sets whether errors are suppressed or not Notes: - Errors cannot be suppressed if not handling errors.
- Errors cannot be un-suppressed if original mode dis-allowed visible errors
at line 117
$this
then($callback, $onErrorState = false)
Add this callback to the chain of callbacks to call along with the state that $error must be in this point in the chain for the callback to be called
at line 131
$this
thenWhileGood(callable $callback)
Request that the callback is invoked if not errored
at line 141
$this
thenIfErrored(callable $callback)
Request that the callback is invoked on error
at line 151
$this
thenAlways(callable $callback)
Request that the callback is invoked always