NAME
Catalyst::View::Errors::HTML - Standard HTTP Errors Responses in HTML
SYNOPSIS
package MyApp::View::HTML;
use Moose;
extends 'Catalyst::View::Errors::HTML';
__PACKAGE__->meta->make_immutable;
DESCRIPTION
View class for generating error responses. If you want a lot of customizations you can subclass this in your application, or just use your own view. You can customize this by adding a template at $APPHOME/root/http_errors_html.tmpl
(using Text::Template as the templating system)
The follow field arguments are passed to this template:
- lang
-
Defaults to "en_US". This is the language code of the error response.
- message
-
This is a text message of the error condition
- status_code
-
This is the HTTP Status code of the error
- title
-
The official HTTP Status error title (Not Found, Not Authorized, etc.)
- uri
-
The URI that generated the error. Be careful displaying this in your template since if its not properly escaped you can open yourself to HTML injection / Javascript injection attackes.
In addition any other arguments passed in ->dispatch_error / ->detach_error.
METHODS
This view exposes the follow methods for public use or for a programmer to override to change function.
html
Should return a string suitable for Text::Template and is used to generate an HTML error response. This is used if there's no file at $APPHOME/root/http_errors_html.tmpl
CONFIGURATION
This View exposes the following configuration options
template_engine_args
Args that are used to start the Text::Template template engin
template_name
Name of the files under $APPHOME/root that is used to render an error view. Default is http_errors_html.tmpl
. If this this file doesn't exist we instead use the return of "html" method for the template string.