| 1 | package File::DataClass::Exception; | ||
| 2 | |||
| 3 | 8 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 8 | ▶ | use Unexpected::Functions qw( has_exception ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 8 | ▶ | use Unexpected::Types qw( Str ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 8 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 8 | extends q(Unexpected); | |
| 10 | 8 | with q(Unexpected::TraitFor::ErrorLeader); | |
| 11 | 8 | with q(Unexpected::TraitFor::ExceptionClasses); | |
| 12 | |||
| 13 | 8 | my $class = __PACKAGE__; $class->ignore_class( 'File::DataClass::IO' ); | |
| 14 | |||
| 15 | 8 | has_exception $class; | |
| 16 | |||
| 17 | 8 | has_exception 'NothingUpdated' => parents => [ $class ], | |
| 18 | error => 'Nothing updated'; | ||
| 19 | |||
| 20 | 8 | has_exception 'PathAlreadyExists' => parents => [ $class ], | |
| 21 | error => 'Path [_1] already exists'; | ||
| 22 | |||
| 23 | 8 | has_exception 'PathNotFound' => parents => [ $class ], | |
| 24 | error => 'Path [_1] not found'; | ||
| 25 | |||
| 26 | 8 | has_exception 'InvocantUndefined' => parents => [ $class ], | |
| 27 | error => 'Method [_1] cannot call with undefined invocant'; | ||
| 28 | |||
| 29 | 8 | has_exception 'RecordAlreadyExists' => parents => [ $class ], | |
| 30 | error => 'File [_1] record [_2] already exists'; | ||
| 31 | |||
| 32 | 8 | has_exception 'RecordNotFound' => parents => [ $class ], | |
| 33 | error => 'File [_1] record [_2] does not exist'; | ||
| 34 | |||
| 35 | 8 | has '+class' => default => $class; | |
| 36 | |||
| 37 | 8 | has 'out' => is => 'ro', isa => Str, default => q(); | |
| 38 | |||
| 39 | 8 | 1; | |
| 40 | |||
| 41 | __END__ | ||