CatalystX-Errors
view release on metacpan or search on metacpan
lib/CatalystX/Utils/DoesHttpException.pm view on Meta::CPAN
A more detailed example:
package Catalyst::ActionRole::Verbs::Utils::MethodNotAllowed;
use Moose;
use namespace::clean -except => 'meta';
with 'CatalystX::Utils::DoesHttpException';
has resource => (is=>'ro', required=>1);
has allowed_methods => (is=>'ro', isa=>'ArrayRef[Str]', required=>1);
has attempted_method => (is=>'ro', isa=>'Str', required=>1);
sub status { 405 }
sub error { "invalid method '@{[ $_[0]->attempted_method ]}' }
sub message {
"HTTP Method '@{[ $_[0]->attempted_method ]}' not permitted for resource '@{[ $_[0]->resource ]}'." .
"Can only be: @{[ join ', ', @{$_[0]->allowed_methods||[]} ]}";
);
__PACKAGE__->meta->make_immutable;
( run in 0.651 second using v1.01-cache-2.11-cpan-5f2e87ce722 )