blib/lib/XAS/Exception.pm

filter: Statementstmt 41.6% 5 / 12 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 100% 1 / 1 totaltotal 36.8% 7 / 19 CC 4 SCAR 27.9
CC
4
Cov
31%
stack_trace
20.0
BEGIN
1.0
CRAP 16.2
« blib/lib/XAS/Lib/Mixins/Keepalive.pm ↑ Summary blib/lib/XAS/Singleton.pm »
1 package XAS::Exception;
2  
3 1 ▶use base Badger::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 $Badger::Exception::TRACE = 1;
5  
6 sub stack_trace {
7 0 ▶ my $self = shift;
Subroutine stack_trace: not called CC=4 SCAR=30.0
Pod documented
8  
9 0 my @lines;
10  
11 0 ▶ if (my $stack = $self->{ stack }) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $stack = $self->{"stack"}) 0 0 0
12  
13 0 foreach my $caller (@$stack) {
14  
15 # ignore Try::Tiny lines
16  
17 0 ▶ next if (grep( $_ =~ /Try::Tiny/, @$caller ));
Branch: 1 branch
BranchTrueFalseTotal
if grep(($_ =~ /Try::Tiny/), @$caller) 0 0 0
18 0 push(@lines, $self->message( caller => @$caller ));
19  
20 }
21  
22 }
23  
24 0 return join("\n", @lines);
25  
26 }
27  
28 1 1;
29  
30 __END__
31  
32 =head1 NAME
33  
34 XAS::Exception - The base exception class for the XAS environment
35  
36 =head1 DESCRIPTION
37  
38 This module defines a base exception class for the XAS Environment and
39 inherits from L<Badger::Exception|https://metacpan.org/Badger::Exception>.
40 The only differences is that it turns stack tracing on by default.
41  
42 =head1 METHODS
43  
44 =head2 stack_trace
45  
46 Removes any reference to L<Try::Tiny|https://metacpan.org/pod/Try::Tiny> in the stack trace.
47  
48 =head1 SEE ALSO
49  
50 =over 4
51  
52 =item L<XAS|XAS>
53  
54 =back
55  
56 =head1 AUTHOR
57  
58 Kevin L. Esteb, E<lt>kevin@kesteb.usE<gt>
59  
60 =head1 COPYRIGHT AND LICENSE
61  
62 Copyright (C) 2014 Kevin L. Esteb
63  
64 This is free software; you can redistribute it and/or modify it under
65 the terms of the Artistic License 2.0. For details, see the full text
66 of the license at http://www.perlfoundation.org/artistic_license_2_0.
67  
68 =cut
« blib/lib/XAS/Lib/Mixins/Keepalive.pm ↑ Summary blib/lib/XAS/Singleton.pm »