File Coverage

blib/lib/XAS/Exception.pm
Criterion Covered Total %
statement 3 14 21.4
branch 0 6 0.0
condition 0 3 0.0
subroutine 1 4 25.0
pod 3 3 100.0
total 7 30 23.3


line stmt bran cond sub pod time code
1             package XAS::Exception;
2              
3 1     1   3 use base Badger::Exception;
  1         1  
  1         245  
4             $Badger::Exception::TRACE = 1;
5              
6             sub type {
7 0     0 1   my $self = shift;
8              
9             return @_
10             ? ($self->{'type'} = shift)
11 0 0 0       : ($self->{'type'} || $TYPE);
12            
13             }
14              
15             sub type_info {
16 0     0 1   my $self = shift;
17              
18 0           return $self->type, $self->info;
19              
20             }
21              
22             sub stack_trace {
23 0     0 1   my $self = shift;
24              
25 0           my @lines;
26              
27 0 0         if (my $stack = $self->{ stack }) {
28              
29 0           foreach my $caller (@$stack) {
30              
31             # ignore Try::Tiny lines
32              
33 0 0         next if (grep( $_ =~ /Try::Tiny/, @$caller ));
34 0           push(@lines, $self->message( caller => @$caller ));
35              
36             }
37              
38             }
39              
40 0           return join("\n", @lines);
41              
42             }
43              
44             1;
45              
46             __END__