CatalystX::Utils::HttpException - A basic way to throw exceptions
use CatalystX::Utils::HttpException; throw_http $code, %extra; ## OR ## CatalystX::Utils::HttpException->throw(500, %extra); ## OR Subclass for your use case ## package MyApp::Exception::Custom; use Moose; extends 'CatalystX::Utils::HttpException'; has '+status' => (init_arg=>undef, default=>sub {418}); has '+errors' => (init_args=?indef, default=>sub {'Coffee not allowed!'});
If you need to throw an exception from code called by Catalyst, such as code deep inside your DBIx::Class classes and you want to signal how to handle the issue you an use this. You can also use this to subclass your own custom messages that will get properly handled in a web context.
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.