$_options
$_options : array
Options to use for the Error handling.
Base error handler that provides logic common to the CLI + web error/exception handlers.
Subclasses are required to implement the template methods to handle displaying the errors in their environment.
handleError(integer $code, string $description, string|null $file = null, integer|null $line = null, array|null $context = null) : boolean
Set as the default error handler by CakePHP.
Use config/error.php to customize or replace this error handler. This function will use Debugger to display errors when debug > 0. And will log errors to Log, when debug == 0.
You can use the 'errorLevel' option to set what type of errors will be handled. Stack traces for errors can be enabled with the 'trace' option.
integer | $code | Code of error |
string | $description | Error description |
string|null | $file | File on which error occurred |
integer|null | $line | Line that triggered the error |
array|null | $context | Context |
True if error was handled
wrapAndHandleException(\Exception|\Error $exception) : void
Checks the passed exception type. If it is an instance of `Error` then, it wraps the passed object inside another Exception object for backwards compatibility purposes.
\Exception|\Error | $exception | The exception to handle |
handleFatalError(integer $code, string $description, string $file, integer $line) : boolean
Display/Log a fatal error.
integer | $code | Code of error |
string | $description | Error description |
string | $file | File on which error occurred |
integer | $line | Line that triggered the error |
_displayError(array $error, boolean $debug) : void
Display an error message in an environment specific way.
Subclasses should implement this method to display the error as desired for the runtime they operate in.
array | $error | An array of error data. |
boolean | $debug | Whether or not the app is in debug mode. |
_requestContext(\Cake\Http\ServerRequest $request) : string
Get the request context for an error/exception trace.
\Cake\Http\ServerRequest | $request | The request to read from. |
Loading…