DHL/Exception.pm

filter: Statementstmt 92.0% 23 / 25 Branchbran n/a Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 100% 2 / 2 totaltotal 82.0% 32 / 39 CC 3 SCAR 6.7
CC
3
Cov
86%
as_string
3.2
as_string
2.0
BEGIN
1.0
CRAP 2.0
« DHL.pm ↑ Summary DHL/Address.pm »
1 package Net::Async::Webservice::DHL::Exception;
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 our $VERSION = '1.2.2'; # VERSION
5  
6 # ABSTRACT: exception classes for DHL
7  
8  
9 {package Net::Async::Webservice::DHL::Exception::ConfigError; ## no critic(ProhibitMultiplePackages)
10 4 ▶ use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 extends 'Net::Async::Webservice::Common::Exception';
12  
13  
14 4 has file => ( is => 'ro', required => 1 );
15  
16  
17 0 ▶ sub as_string {
Subroutine as_string: not called CC=1 SCAR=6.9
Pod documented
18 0 my ($self) = @_;
19  
20 0 return 'Bad config file: %s, at %s',
21 $self->file,
22 $self->stack_trace->as_string;
23 }
24 }
25  
26 4 {package Net::Async::Webservice::DHL::Exception::DHLError; ## no critic(ProhibitMultiplePackages)
27 4 ▶ use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 4 extends 'Net::Async::Webservice::Common::Exception';
29  
30  
31 4 has error => ( is => 'ro', required => 1 );
32  
33  
34 1 ▶ sub as_string {
Subroutine as_string: called CC=3 SCAR=11.7
Pod documented
35 1 my ($self) = @_;
36  
37 1 my $c = $self->error->{Condition}[0];
38  
39 return sprintf 'DHL returned an error: %s, code %s, at %s',
40 $c->{ConditionData}//'<undef>',
41 1 ▶ $c->{ConditionCode}//'<undef>',
Condition50%2/4
$c->{"ConditionData"} // "<undef>"
l!l
10
$c->{"ConditionCode"} // "<undef>"
l!l
10
MC/DC0%0/1
$c->{"ConditionData"} // "<undef>"
$c->{"ConditionData"}
MC/DC0%0/1
$c->{"ConditionCode"} // "<undef>"
$c->{"ConditionCode"}
Truth table50%1/2
A
A= $c->{"ConditionData"}
Aresult
11
00
Truth table50%1/2
A
A= $c->{"ConditionCode"}
Aresult
11
00
42 $self->stack_trace->as_string;
43 }
44 }
45  
46 4 1;
47  
48 __END__
« DHL.pm ↑ Summary DHL/Address.pm »