Catalyst::View::Errors::JSON - Standard HTTP Errors Responses in JSON
package MyApp::View::JSON; use Moose; extends 'Catalyst::View::Errors::JSON'; __PACKAGE__->meta->make_immutable;
Used to generate a JSON error response in standard way.
This view exposes the follow methods for public use or for a programmer to override to change function.
Finalizes the hash of data that is sent to the template handler to make the body of the error response. You can override if you want to change or add to this data.
By default you get an error message that looks like this:
{ "info" : { "lang" : "en_US", "uri" : "http://localhost:5000/" }, "errors" : [ { "title" : "Resource not found", "messge" : "The requested resource could not be found but may be available again in the future.", "status_code" : 404 } ] }
If you're passing extra template args you'll need to override this method to handle things as you wish.
This View exposes the following configuration options
Extra args used to initialize the JSON::MaybeXS object.
When doing content negotiation if there's no language preferred by the client use this language. Default is en_US.
en_US
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.