| 1 | package WebService::TypeSafe::Error; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use overload '""' => 'as_string', fallback => 1; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 4 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 8 | 4 | my ($class, %args) = @_; | |||||||||||||||||||||||||||
| 9 | 4 | return bless \%args, $class; | |||||||||||||||||||||||||||
| 10 | } | ||||||||||||||||||||||||||||
| 11 | 0 | ▶ | sub as_string { return $_[0]->{message} // ref($_[0]) } | ||||||||||||||||||||||||||
|
Subroutine
as_string: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
$_[0]{"message"} // ref $_[0]
MC/DC0%0/1
$_[0]{"message"} // ref $_[0]
$_[0]{"message"}
Truth table0%0/2
A
A= $_[0]{"message"}
| |||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub message { $_[0]->{message} } | ||||||||||||||||||||||||||
|
Subroutine
message: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | package WebService::TypeSafe::APIError; | ||||||||||||||||||||||||||||
| 15 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::Error'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | 2 | ▶ | sub status { $_[0]->{status} } | ||||||||||||||||||||||||||
|
Subroutine
status: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | 1 | ▶ | sub body { $_[0]->{body} } | ||||||||||||||||||||||||||
|
Subroutine
body: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub headers { $_[0]->{headers} } | ||||||||||||||||||||||||||
|
Subroutine
headers: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub endpoint { $_[0]->{endpoint} } | ||||||||||||||||||||||||||
|
Subroutine
endpoint: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 20 | 1 | ▶ | sub request_id { $_[0]->{headers}{'x-typesafe-request-id'} } | ||||||||||||||||||||||||||
|
Subroutine
request_id: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub retry_after_ms { | ||||||||||||||||||||||||||
|
Subroutine
retry_after_ms: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||
| 22 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 23 | 0 | ▶ | return $self->{headers}{'retry-after-ms'} if defined $self->{headers}{'retry-after-ms'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | return 1000 * $self->{headers}{'retry-after'} | ||||||||||||||||||||||||||||
| 25 | 0 | ▶ | if defined($self->{headers}{'retry-after'}) && $self->{headers}{'retry-after'} =~ /^\d+(?:\.\d+)?$/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->{"headers"}{"retry-after"} and $self->{"headers"}{"retry-after"} =~ /^\d+(?:\.\d+)?$/
MC/DC0%0/2
defined $self->{"headers"}{"retry-after"} and $self->{"headers"}{"retry-after"} =~ /^\d+(?:\.\d+)?$/
defined $self->{"headers"}{"retry-after"}
$self->{"headers"}{"retry-after"} =~ /^\d+(?:\.\d+)?$/
Truth table0%0/3
A and B
A= defined $self->{"headers"}{"retry-after"}B= $self->{"headers"}{"retry-after"} =~ /^\d+(?:\.\d+)?$/
| |||||||||||||||||||||||||||||
| 26 | 0 | return undef; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | package WebService::TypeSafe::BadRequestError; | ||||||||||||||||||||||||||||
| 30 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::APIError'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 31 | package WebService::TypeSafe::AuthenticationError; | ||||||||||||||||||||||||||||
| 32 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::APIError'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 33 | package WebService::TypeSafe::PermissionDeniedError; | ||||||||||||||||||||||||||||
| 34 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::APIError'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 35 | package WebService::TypeSafe::NotFoundError; | ||||||||||||||||||||||||||||
| 36 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::APIError'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 37 | package WebService::TypeSafe::UnprocessableEntityError; | ||||||||||||||||||||||||||||
| 38 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::APIError'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 39 | package WebService::TypeSafe::RateLimitError; | ||||||||||||||||||||||||||||
| 40 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::APIError'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 41 | package WebService::TypeSafe::InternalServerError; | ||||||||||||||||||||||||||||
| 42 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::APIError'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 43 | package WebService::TypeSafe::ConnectionError; | ||||||||||||||||||||||||||||
| 44 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::Error'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 45 | package WebService::TypeSafe::TimeoutError; | ||||||||||||||||||||||||||||
| 46 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::ConnectionError'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 47 | 1 | ▶ | sub timeout { $_[0]->{timeout} } | ||||||||||||||||||||||||||
|
Subroutine
timeout: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 48 | package WebService::TypeSafe::ResponseValidationError; | ||||||||||||||||||||||||||||
| 49 | 3 | ▶ | use parent -norequire, 'WebService::TypeSafe::APIError'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 50 | 0 | ▶ | sub field_path { $_[0]->{field_path} } | ||||||||||||||||||||||||||
|
Subroutine
field_path: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 3 | 1; | |||||||||||||||||||||||||||