File Coverage

lib/File/DataClass/Exception.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


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