blib/lib/CGI/ExceptionManager.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 8 / 8 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 100% 50 / 50 SCAR 17.9
CC
6
Cov
100%
run
4.0
__ANON__
3.0
BEGIN
1.0
CRAP 6.0
« Build ↑ Summary
1 package CGI::ExceptionManager;
2 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use 5.00800;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 our $VERSION = '0.06';
6  
7 2 ▶sub detach { die bless [@_], 'CGI::ExceptionManager::Exception' }
Subroutine detach: called CC=1 SCAR=0.0
Pod documented
8  
9 6 my $stacktrace_required;
10  
11 sub run {
12 6 ▶ my ($class, %args) = @_;
Subroutine run: called CC=4 SCAR=13.9
Pod documented
13  
14 6 my $response;
15 my $err_info;
16 local $SIG{__DIE__} = sub {
17 6 ▶ my ($msg) = @_;
Subroutine __ANON__: called CC=3 SCAR=11.0
18 6 ▶ if (ref $msg eq 'CGI::ExceptionManager::Exception') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $msg eq 'CGI::ExceptionManager::Exception') { } 2 4 6
19 2 $response = $msg->[0];
20 2 undef $err_info;
21 } else {
22 4 ▶ unless ($stacktrace_required) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($stacktrace_required) 3 1 4
23 3 require CGI::ExceptionManager::StackTrace;
24 3 $stacktrace_required = 1;
25 }
26 4 $err_info = CGI::ExceptionManager::StackTrace->new($msg);
27 }
28 6 die $msg;
29 6 };
30 6 local $@;
31 6 eval {
32 6 $response = $args{callback}->();
33 1 undef $err_info;
34 };
35 6 ▶ if ($err_info) {
Branch: 1 branch
BranchTrueFalseTotal
if ($err_info) 3 3 6
36 $err_info->output(
37 powered_by => $args{powered_by} || __PACKAGE__,
38 3 ▶ ($args{renderer} ? (renderer => $args{renderer}) : ())
Branch: 1 branch
BranchTrueFalseTotal
$args{'renderer'} ? : 1 2 3
Condition100%2/2
$args{'powered_by'} || __PACKAGE__
l!l
21
MC/DC100%1/1
$args{'powered_by'} || __PACKAGE__
$args{'powered_by'}
Truth table100%2/2
A
A= $args{'powered_by'}
Aresult
11
00
39 );
40 }
41 6 return $response;
42 }
43  
44 6 1;
45 __END__
« Build ↑ Summary