| 1 | package Net::Amazon::S3::Error::Handler::Confess; | ||||||||||||||||||||||||||||
| 2 | 99 | $Net::Amazon::S3::Error::Handler::Confess::VERSION = '0.992'; | |||||||||||||||||||||||||||
| 3 | # ABSTRACT: An internal class to report errors via Carp::confess | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 99 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 99 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 99 | ▶ | use HTTP::Status; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 99 | extends 'Net::Amazon::S3::Error::Handler'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 99 | our @CARP_NOT = (__PACKAGE__); | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 99 | my %return_false = ( | |||||||||||||||||||||||||||
| 14 | NoSuchKey => { | ||||||||||||||||||||||||||||
| 15 | 'Net::Amazon::S3::Operation::Object::Head::Response' => 1, | ||||||||||||||||||||||||||||
| 16 | }, | ||||||||||||||||||||||||||||
| 17 | NoSuchBucket => { | ||||||||||||||||||||||||||||
| 18 | 'Net::Amazon::S3::Operation::Object::Head::Response' => 1, | ||||||||||||||||||||||||||||
| 19 | }, | ||||||||||||||||||||||||||||
| 20 | '404' => { | ||||||||||||||||||||||||||||
| 21 | 'Net::Amazon::S3::Operation::Object::Head::Response' => 1, | ||||||||||||||||||||||||||||
| 22 | }, | ||||||||||||||||||||||||||||
| 23 | ); | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 99 | ▶ | sub handle_error { | ||||||||||||||||||||||||||
|
Subroutine
handle_error: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||
| 26 | 99 | my ($self, $response) = @_; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 99 | ▶ | return 1 unless $response->is_error; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | return 0 | ||||||||||||||||||||||||||||
| 31 | if exists $return_false{ $response->error_code } | ||||||||||||||||||||||||||||
| 32 | 57 | ▶ | && exists $return_false{ $response->error_code }{ ref $response } | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
exists $return_false{$response->error_code} and exists $return_false{$response->error_code}{ref $response}
MC/DC100%2/2
exists $return_false{$response->error_code} and exists $return_false{$response->error_code}{ref $response}
exists $return_false{$response->error_code}
exists $return_false{$response->error_code}{ref $response}
Truth table100%3/3
A and B
A= exists $return_false{$response->error_code}B= exists $return_false{$response->error_code}{ref $response}
| |||||||||||||||||||||||||||||
| 33 | ; | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 55 | Carp::confess ("${\ $response->error_code }: ${\ $response->error_message }"); | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 99 | 1; | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | __END__ | ||||||||||||||||||||||||||||