| 1 | package Web::ComposableRequest::Exception; | ||
| 2 | |||
| 3 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | ▶ | use Unexpected::Functions qw( has_exception ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Unexpected::Types qw( Int ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | extends q(Unexpected); | |
| 10 | 1 | with q(Unexpected::TraitFor::ErrorLeader); | |
| 11 | 1 | with q(Unexpected::TraitFor::ExceptionClasses); | |
| 12 | |||
| 13 | 1 | my $class = __PACKAGE__; | |
| 14 | |||
| 15 | 1 | $class->ignore_class( 'Sub::Quote' ); | |
| 16 | |||
| 17 | 1 | has_exception $class; | |
| 18 | |||
| 19 | 1 | has '+class' => default => $class; | |
| 20 | |||
| 21 | 1 | has 'rv' => is => 'ro', isa => Int, default => 1; | |
| 22 | |||
| 23 | 1 | has_exception 'BadCSRFToken' => parent => [$class], | |
| 24 | error => 'CSRF verification failed: [_1]'; | ||
| 25 | |||
| 26 | 1 | has_exception 'UnknownMethod' => parents => [$class], | |
| 27 | error => 'Class [_1] has no method [_2]'; | ||
| 28 | |||
| 29 | 1 | 1; | |
| 30 | |||
| 31 | __END__ | ||