Usul/Exception.pm

filter: Statementstmt 100% 26 / 26 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 30 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Usul/Lock.pm ↑ Summary Usul/Getopt.pm »
1 package Class::Usul::Exception;
2  
3 28 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 28 ▶use Unexpected::Functions qw( has_exception );
Subroutine BEGIN: called CC=1 SCAR=0.0
6 28 ▶use Unexpected::Types qw( Int Str );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 28 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 28 extends q(Unexpected);
10 28 with q(Unexpected::TraitFor::ErrorLeader);
11 28 with q(Unexpected::TraitFor::ExceptionClasses);
12  
13 28 my $class = __PACKAGE__;
14  
15 28 $class->ignore_class( 'Class::Usul::IPC', 'Sub::Quote' );
16  
17 28 has_exception $class;
18  
19 28 has_exception 'DateTimeCoercion' => parents => [ $class ],
20 error => 'String [_1] will not coerce to a Unix time value';
21  
22 28 has_exception 'Tainted' => parents => [ $class ],
23 error => 'String [_1] contains possible taint';
24  
25 28 has_exception 'TimeOut' => parents => [ $class ],
26 error => 'Command [_1] timed out after [_2] seconds';
27  
28 28 has '+class' => default => $class;
29  
30 28 has 'out' => is => 'ro', isa => Str, default => q();
31  
32 28 has 'rv' => is => 'ro', isa => Int, default => 1;
33  
34 28 has 'time' => is => 'ro', isa => Int, default => CORE::time(),
35 init_arg => undef;
36  
37 28 1;
38  
39 __END__
« Usul/Lock.pm ↑ Summary Usul/Getopt.pm »