Catalyst::View::Errors::Text - Standard HTTP Errors Responses in Plain Text.
package MyApp::View::Text; use Moose; extends 'Catalyst::View::Errors::Text'; __PACKAGE__->meta->make_immutable;
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.
This view exposes the follow methods for public use or for a programmer to override to change function.
The follow field arguments are passed to this template:
Defaults to "en_US". This is the language code of the error response.
This is a text message of the error condition
This is the HTTP Status code of the error
The official HTTP Status error title (Not Found, Not Authorized, etc.)
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.
Should return a string suitable for Text::Template and is used to generate a plain text error response. This is used if there's no file at $APPHOME/root/http_errors_text.tmpl
$APPHOME/root/http_errors_text.tmpl
This View exposes the following configuration options
Args that are used to start the Text::Template template engin
Name of the files under $APPHOME/root that is used to render an error view. Default is http_errors_text.tmpl. If this this file doesn't exist we instead use the return of "text" method for the template string.
http_errors_text.tmpl
CatalystX::Errors.
To install CatalystX::Errors, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::Errors
CPAN shell
perl -MCPAN -e shell install CatalystX::Errors
For more information on module installation, please visit the detailed CPAN module installation guide.