$error
$error : \Exception
The exception being handled.
Exception Renderer.
Captures and handles all unhandled exceptions. Displays helpful framework errors when debug is true. When debug is false a CakeException will render 404 or 500 errors. If an uncaught exception is thrown and it is a type that ExceptionHandler does not know about it will be treated as a 500 error.
You can implement application specific exception handling by creating a subclass of
ExceptionRenderer and configure it to be the exceptionRenderer
in config/error.php
Using a subclass of ExceptionRenderer gives you full control over how Exceptions are rendered, you can configure your class in your config/app.php.
$controller : \Cake\Controller\Controller
Controller instance.
$request : \Cake\Http\ServerRequest|null
If set, this will be request used to create the controller that will render the error.
__construct(\Exception $exception, \Cake\Http\ServerRequest $request = null)
Creates the controller to perform rendering on the error response.
If the error is a Cake\Core\Exception\Exception it will be converted to either a 400 or a 500 code error depending on the code used to construct the error.
\Exception | $exception | Exception. |
\Cake\Http\ServerRequest | $request | The request - if this is set it will be used instead of creating a new one |
render() : \Cake\Http\Response
Renders the response for the exception.
The response to be sent.
_getController() : \Cake\Controller\Controller
Get the controller instance to handle the exception.
Override this method in subclasses to customize the controller used.
This method returns the built in ErrorController
normally, or if an error is repeated
a bare controller will be used.
_customMethod(string $method, \Exception $exception) : \Cake\Http\Response
Render a custom error method/template.
string | $method | The method name to invoke. |
\Exception | $exception | The exception to render. |
The response to send.
_outputMessage(string $template) : \Cake\Http\Response
Generate the response using the controller object.
string | $template | The template to render. |
A response object that can be sent.
_outputMessageSafe(string $template) : \Cake\Http\Response
A safer way to render error messages, replaces all helpers, with basics and doesn't call component methods.
string | $template | The template to render. |
A response object that can be sent.
_shutdown() : \Cake\Http\Response
Run the shutdown events.
Triggers the afterFilter and afterDispatch events.
The response to serve.
Loading…