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 protected $error protected Exception$method protected string$request protected If set, this will be request used to create the controller that will render the error.
$template protected stringCreates 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.
Returns an array that can be used to describe the internal state of this object.
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.
A safer way to render error messages, replaces all helpers, with basics and doesn't call component methods.
Returns the unwrapped exception object in case we are dealing with a PHP 7 Error object
__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 Cake\Http\ServerRequest $request optional null __debugInfo( )
Returns an array that can be used to describe the internal state of this object.
__get( string $name )
Magic accessor for properties made protected.
$name __set( string $name , mixed $value )
Magic setter for properties made protected.
$name $value _code( Exception $exception )
Get HTTP status code.
$exception _customMethod( string $method , Exception $exception )
Render a custom error method/template.
$method $exception Cake\Http\Response_getController( )
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.
Cake\Controller\Controller_message( Exception $exception , integer $code )
Get error message.
$exception $code _method( Exception $exception )
Get method name
$exception _outputMessage( string $template )
Generate the response using the controller object.
$template Cake\Http\Response_outputMessageSafe( string $template )
A safer way to render error messages, replaces all helpers, with basics and doesn't call component methods.
$template Cake\Http\Response_shutdown( )
Run the shutdown events.
Triggers the afterFilter and afterDispatch events.
Cake\Http\Response_template( Exception $exception , string $method , integer $code )
Get template for rendering exception info.
$exception $method $code _unwrap( Exception $exception )
Returns the unwrapped exception object in case we are dealing with a PHP 7 Error object
$exception render( )
Renders the response for the exception.
Cake\Http\ResponseCake\Error\ExceptionRendererInterface::render() protected Cake\Http\ServerRequest|null
If set, this will be request used to create the controller that will render the error.
null
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.8/class-Cake.Error.ExceptionRenderer.html