UPS/Exception.pm

filter: Statementstmt 89.1% 41 / 46 Branchbran 50.0% 2 / 4 Conditioncond 31.2% 5 / 16 MC/DCmcdc 12.5% 1 / 8 Subroutinesub 84.6% 11 / 13 Podpod 28.5% 2 / 7 totaltotal 65.9% 62 / 94 CC 11 SCAR 21.6
CC
11
Cov
73%
as_string
30.0
as_string
5.7
_error_location_str
3.6
CRAP 8.7
« UPS/ReturnService.pm ↑ Summary UPS.pm »
1 package Net::Async::Webservice::UPS::Exception;
2 6 $Net::Async::Webservice::UPS::Exception::VERSION = '1.1.4';
3 {
4 6 $Net::Async::Webservice::UPS::Exception::DIST = 'Net-Async-Webservice-UPS';
5 }
6 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 {package Net::Async::Webservice::UPS::Exception::BadPackage;
10 6 $Net::Async::Webservice::UPS::Exception::BadPackage::VERSION = '1.1.4';
11 {
12 6 $Net::Async::Webservice::UPS::Exception::BadPackage::DIST = 'Net-Async-Webservice-UPS';
13 }
14 6 ▶ use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 6 extends 'Net::Async::Webservice::Common::Exception';
16 6 ▶ use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18  
19 6 has package => ( is => 'ro', required => 1 );
20  
21  
22 0 ▶ sub as_string {
Subroutine as_string: not called CC=5 SCAR=34.0
Pod documented
23 0 my ($self) = @_;
24  
25 0 ▶ return sprintf 'Package size/weight not supported: %fx%fx%f %s %f %s, at %s',
Condition0%0/8
$self->package->length // "<undef>"
l!l
00
$self->package->width // "<undef>"
l!l
00
$self->package->height // "<undef>"
l!l
00
$self->package->weight // "<undef>"
l!l
00
MC/DC0%0/1
$self->package->length // "<undef>"
$self->package->length
MC/DC0%0/1
$self->package->width // "<undef>"
$self->package->width
MC/DC0%0/1
$self->package->height // "<undef>"
$self->package->height
MC/DC0%0/1
$self->package->weight // "<undef>"
$self->package->weight
Truth table0%0/2
A
A= $self->package->length
Aresult
11
00
Truth table0%0/2
A
A= $self->package->width
Aresult
11
00
Truth table0%0/2
A
A= $self->package->height
Aresult
11
00
Truth table0%0/2
A
A= $self->package->weight
Aresult
11
00
26 $self->package->length//'<undef>',
27 $self->package->width//'<undef>',
28 $self->package->height//'<undef>',
29 $self->package->linear_unit,
30 $self->package->weight//'<undef>',
31 $self->package->weight_unit,
32 $self->stack_trace->as_string;
33 }
34 }
35  
36 6 {package Net::Async::Webservice::UPS::Exception::UPSError;
37 6 $Net::Async::Webservice::UPS::Exception::UPSError::VERSION = '1.1.4';
38 {
39 6 $Net::Async::Webservice::UPS::Exception::UPSError::DIST = 'Net-Async-Webservice-UPS';
40 }
41 6 ▶ use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
42 6 extends 'Net::Async::Webservice::Common::Exception';
43 6 ▶ use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
44  
45  
46 6 has error => ( is => 'ro', required => 1 );
47  
48  
49 3 ▶ sub error_description { $_[0]->error->{ErrorDescription} }
Subroutine error_description: called CC=1 SCAR=0.0
Pod undocumented
50 3 ▶ sub error_severity { $_[0]->error->{ErrorSeverity} }
Subroutine error_severity: called CC=1 SCAR=0.0
Pod undocumented
51 5 ▶ sub error_code { $_[0]->error->{ErrorCode} }
Subroutine error_code: called CC=1 SCAR=0.0
Pod undocumented
52 3 ▶ sub error_location { $_[0]->error->{ErrorLocation} }
Subroutine error_location: called CC=1 SCAR=0.0
Pod undocumented
53 0 ▶ sub retry_seconds { $_[0]->error->{MinimumRetrySeconds} }
Subroutine retry_seconds: not called CC=1 SCAR=6.9
Pod undocumented
54  
55 3 ▶ sub _error_location_str {
Subroutine _error_location_str: called CC=3 SCAR=12.7
56 3 my ($self) = @_;
57 3 my $el = $self->error_location;
58 3 ▶ if ($el->{ErrorLocationElementName}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($el->{'ErrorLocationElementName'}) { } 0 3 3
elsif ($el->{'ErrorLocationAttributeName'}) { } 0 3 3
59 0 return "element ".$el->{ErrorLocationElementName};
60 }
61 elsif ($el->{ErrorLocationAttributeName}) {
62 0 return "attribute ".$el->{ErrorLocationAttributeName};
63 }
64 else {
65 3 return;
66 }
67 }
68  
69  
70 3 ▶ sub as_string {
Subroutine as_string: called CC=5 SCAR=17.4
Pod documented
71 3 my ($self) = @_;
72  
73 3 ▶ return sprintf 'UPS returned an error: %s, severity %s, code %s, location %s, at %s',
Condition62%5/8
$self->error_description // "<undef>"
l!l
30
$self->error_severity // "<undef>"
l!l
21
$self->error_code // "<undef>"
l!l
30
$self->_error_location_str // "<undef>"
l!l
03
MC/DC0%0/1
$self->error_description // "<undef>"
$self->error_description
MC/DC100%1/1
$self->error_severity // "<undef>"
$self->error_severity
MC/DC0%0/1
$self->error_code // "<undef>"
$self->error_code
MC/DC0%0/1
$self->_error_location_str // "<undef>"
$self->_error_location_str
Truth table50%1/2
A
A= $self->error_description
Aresult
11
00
Truth table100%2/2
A
A= $self->error_severity
Aresult
11
00
Truth table50%1/2
A
A= $self->error_code
Aresult
11
00
Truth table50%1/2
A
A= $self->_error_location_str
Aresult
11
00
74 $self->error_description//'<undef>',
75 $self->error_severity//'<undef>',
76 $self->error_code//'<undef>',
77 $self->_error_location_str//'<undef>',
78 $self->stack_trace->as_string;
79 }
80 }
81  
82 6 1;
83  
84 __END__
« UPS/ReturnService.pm ↑ Summary UPS.pm »