Simple/Error.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 8 / 8 Conditioncond 100% 4 / 4 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 36 / 36 CC 7 SCAR 16.5
CC
7
Cov
100%
__ANON__
7.0
BEGIN
1.0
trace
1.0
CRAP 5.2
↑ Summary Simple.pm »
1 package Net::Stripe::Simple::Error;
2 5 $Net::Stripe::Simple::Error::VERSION = '0.006';
3 # ABSTRACT: general error class for Net::Stripe::Simple
4  
5  
6 5 ▶use parent 'Net::Stripe::Simple::Data';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 1 ▶sub trace { shift->{_trace}->as_string }
Subroutine trace: called CC=1 SCAR=0.0
Pod documented
10  
11 5 ▶use overload '""' => sub {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=7 SCAR=19.5
12 65 my $e = shift;
13 65 my ( $type, $message ) = @$e{qw(type message)};
14 65 ▶ $message = '[no message]' unless length( $message // '' );
Branch: 1 branch
BranchTrueFalseTotal
unless length($message // "") 3 62 65
Condition100%2/2
$message // ""
l!l
623
MC/DC100%1/1
$message // ""
$message
Truth table100%2/2
A
A= $message
Aresult
11
00
15 65 ▶ $type = 'unknown' unless length( $type // '' );
Branch: 1 branch
BranchTrueFalseTotal
unless length($type // "") 3 62 65
Condition100%2/2
$type // ""
l!l
623
MC/DC100%1/1
$type // ""
$type
Truth table100%2/2
A
A= $type
Aresult
11
00
16 65 my $msg = sprintf 'Error: %s - %s', $type, $message;
17 65 ▶ $msg .= " On parameter: " . $e->{param} if exists $e->{param};
Branch: 1 branch
BranchTrueFalseTotal
if exists $e->{"param"} 6 59 65
18 65 ▶ $msg .= "\n\tCode: " . $e->{code} if exists $e->{code};
Branch: 1 branch
BranchTrueFalseTotal
if exists $e->{"code"} 7 58 65
19 65 return $msg;
20 5 };
21  
22 5 1;
23  
24 __END__
↑ Summary Simple.pm »