Backwards compatible Exception Renderer.
Cake\Controller\Controller
Controller instance.
Throwable
The exception being handled.
array<string, int>
Map of exceptions to http status codes.
string
The method corresponding to the Exception this object is for.
Cake\Http\ServerRequest|null
If set, this will be request used to create the controller that will render the error.
string
Template to render for {@link \Cake\Core\Exception\CakeException}
Creates the controller to perform rendering on the error response.
Returns an array that can be used to describe the internal state of this object.
Render a custom error method/template.
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.
Get error message.
Get method name
Generate the response using the controller object.
A safer way to render error messages, replaces all helpers, with basics and doesn't call component methods.
Run the shutdown events.
Get template for rendering exception info.
Clear output buffers so error pages display properly.
Gets the appropriate http status code for exception.
Renders the response for the exception.
Emit the response content
__construct(Throwable $exception, Cake\Http\ServerRequest|null $request = null)
Creates the controller to perform rendering on the error response.
Throwable
$exception Exception.
Cake\Http\ServerRequest|null
$request optional The request if this is set it will be used instead of creating a new one.
__debugInfo(): array<string, mixed>
Returns an array that can be used to describe the internal state of this object.
array<string, mixed>
_customMethod(string $method, Throwable $exception): Cake\Http\Response
Render a custom error method/template.
string
$method The method name to invoke.
Throwable
$exception The exception to render.
Cake\Http\Response
_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.
Cake\Controller\Controller
_message(Throwable $exception, int $code): string
Get error message.
Throwable
$exception Exception.
int
$code Error code.
string
_method(Throwable $exception): string
Get method name
Throwable
$exception Exception instance.
string
_outputMessage(string $template): Cake\Http\Response
Generate the response using the controller object.
string
$template The template to render.
Cake\Http\Response
_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.
Cake\Http\Response
_shutdown(): Cake\Http\Response
Run the shutdown events.
Triggers the afterFilter and afterDispatch events.
Cake\Http\Response
_template(Throwable $exception, string $method, int $code): string
Get template for rendering exception info.
Throwable
$exception Exception instance.
string
$method Method name.
int
$code Error code.
string
clearOutput(): void
Clear output buffers so error pages display properly.
void
getHttpCode(Throwable $exception): int
Gets the appropriate http status code for exception.
Throwable
$exception Exception.
int
render(): Cake\Http\Response
Renders the response for the exception.
Cake\Http\Response
write(Psr\Http\Message\ResponseInterface|string $output): void
Emit the response content
Psr\Http\Message\ResponseInterface|string
$output The response to output.
void
Controller instance.
Cake\Controller\Controller
The exception being handled.
Throwable
Map of exceptions to http status codes.
This can be customized for users that don't want specific exceptions to throw 404 errors or want their application exceptions to be automatically converted.
array<string, int>
The method corresponding to the Exception this object is for.
string
If set, this will be request used to create the controller that will render the error.
Cake\Http\ServerRequest|null
Template to render for {@link \Cake\Core\Exception\CakeException}
string
© 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/4.4/class-Cake.Error.ExceptionRenderer.html