REST/Exception.pm

filter: Statementstmt 60.0% 12 / 20 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 2 / 3 Podpod n/a totaltotal 45.1% 14 / 31 CC 5 SCAR 30.8
CC
5
Cov
43%
__ANON__
30.0
BEGIN
1.6
BEGIN
1.0
CRAP 21.8
↑ Summary REST/Config.pm »
1 package Opsview::REST::Exception;
2 {
3 9 $Opsview::REST::Exception::VERSION = '0.013';
4 }
5  
6 9 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 use overload
9 9 ▶ '""' => sub {
Subroutine BEGIN: called CC=1 SCAR=4.7
Subroutine __ANON__: not called CC=5 SCAR=34.0
10 0 my $error = join (' ', $_[0]->status, $_[0]->reason);
11 0 ▶ my $msg = $_[0]->message; chomp $msg if $msg;
Branch: 1 branch
BranchTrueFalseTotal
if $msg 0 0 0
12 0 ▶ my $dtl = $_[0]->detail; chomp $dtl if $dtl;
Branch: 1 branch
BranchTrueFalseTotal
if $dtl 0 0 0
13  
14 0 ▶ $error = join ': ', $error, $msg if ($msg);
Branch: 1 branch
BranchTrueFalseTotal
if $msg 0 0 0
15 0 ▶ $error = join '; ', $error, $dtl if ($dtl);
Branch: 1 branch
BranchTrueFalseTotal
if $dtl 0 0 0
16  
17 0 return "$error\n";
18 },
19 9 fallback => 1;
20  
21  
22 9 has [qw/status reason/] => (
23 is => 'ro',
24 required => 1,
25 );
26  
27 9 has [qw/message detail/] => (
28 is => 'ro',
29 required => 0,
30 );
31  
32 9 __PACKAGE__->meta->make_immutable;
33  
34 9 1;
35  
36 __END__
↑ Summary REST/Config.pm »