| 1 | package Net::Amazon::S3::Error::Handler::Confess; | ||||||||||||||||||||||||||||
| 2 | 99 | $Net::Amazon::S3::Error::Handler::Confess::VERSION = '0.991'; | |||||||||||||||||||||||||||
| 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 | sub handle_error { | ||||||||||||||||||||||||||||
| 26 | 99 | ▶ | my ($self, $response) = @_; | ||||||||||||||||||||||||||
|
Subroutine
handle_error: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | =pod | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | =encoding UTF-8 | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | =head1 NAME | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | Net::Amazon::S3::Error::Handler::Confess - An internal class to report errors via Carp::confess | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | =head1 VERSION | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | version 0.991 | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | Carp::confess on error. | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | Branislav Zahradník <barney@cpan.org> | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník. | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 67 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | =cut | ||||||||||||||||||||||||||||