line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Amazon::S3::Error::Handler::Confess; |
2
|
|
|
|
|
|
|
$Net::Amazon::S3::Error::Handler::Confess::VERSION = '0.98'; |
3
|
|
|
|
|
|
|
# ABSTRACT: An internal class to report errors via Carp::confess |
4
|
|
|
|
|
|
|
|
5
|
96
|
|
|
96
|
|
758
|
use Moose; |
|
96
|
|
|
|
|
229
|
|
|
96
|
|
|
|
|
740
|
|
6
|
96
|
|
|
96
|
|
646979
|
use Carp; |
|
96
|
|
|
|
|
257
|
|
|
96
|
|
|
|
|
6757
|
|
7
|
96
|
|
|
96
|
|
693
|
use HTTP::Status; |
|
96
|
|
|
|
|
226
|
|
|
96
|
|
|
|
|
52428
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends 'Net::Amazon::S3::Error::Handler'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @CARP_NOT = (__PACKAGE__); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub handle_error { |
23
|
93
|
|
|
93
|
0
|
325
|
my ($self, $response) = @_; |
24
|
|
|
|
|
|
|
|
25
|
93
|
100
|
|
|
|
560
|
return 1 unless $response->is_error; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
return 0 |
28
|
|
|
|
|
|
|
if exists $return_false{ $response->error_code } |
29
|
53
|
100
|
100
|
|
|
2396
|
&& exists $return_false{ $response->error_code }{ ref $response } |
30
|
|
|
|
|
|
|
; |
31
|
|
|
|
|
|
|
|
32
|
51
|
|
|
|
|
136
|
Carp::confess ("${\ $response->error_code }: ${\ $response->error_message }"); |
|
51
|
|
|
|
|
1464
|
|
|
51
|
|
|
|
|
1650
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=encoding UTF-8 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Net::Amazon::S3::Error::Handler::Confess - An internal class to report errors via Carp::confess |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 VERSION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
version 0.98 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 DESCRIPTION |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Carp::confess on error. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 AUTHOR |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Branislav Zahradník <barney@cpan.org> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This software is copyright (c) 2021 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
64
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |