File Coverage

blib/lib/Error/Tiny/Catch.pm
Criterion Covered Total %
statement 16 16 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 0 3 0.0
total 22 26 84.6


line stmt bran cond sub pod time code
1             package Error::Tiny::Catch;
2              
3 1     1   5 use strict;
  1         1  
  1         26  
4 1     1   4 use warnings;
  1         2  
  1         125  
5              
6             sub new {
7 18     18 0 31 my $class = shift;
8 18         60 my (%params) = @_;
9              
10 18         36 my $self = {};
11 18         62 bless $self, $class;
12              
13 18         77 $self->{handler} = $params{handler};
14 18         38 $self->{class} = $params{class};
15              
16 18 50       57 Carp::croak('class is required') unless $self->{class};
17              
18 18         107 return $self;
19             }
20              
21 12     12 0 45 sub handler { $_[0]->{handler} }
22 14     14 0 91 sub class { $_[0]->{class} }
23              
24             1;