line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
$Net::Amazon::S3::Error::Handler::X::VERSION = '0.991'; |
2
|
|
|
|
|
|
|
# ABSTRACT: Throw error specific exception |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use Moose; |
5
|
1
|
|
|
1
|
|
383
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
extends 'Net::Amazon::S3::Error::Handler'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Net::Amazon::S3::X; |
9
|
1
|
|
|
1
|
|
5380
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
10
|
|
|
|
|
|
|
override handle_error => sub { |
11
|
|
|
|
|
|
|
my ($self, $response, $request) = @_; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
return 1 unless $response->is_error; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $exception = Net::Amazon::S3::X->build ( |
16
|
|
|
|
|
|
|
$response->error_code, |
17
|
|
|
|
|
|
|
request => $request, |
18
|
|
|
|
|
|
|
response => $response, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
die $exception; |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=encoding UTF-8 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Net::Amazon::S3::Error::Handler::X - Throw error specific exception |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 VERSION |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
version 0.991 |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 DESCRIPTION |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Raise error specific exception. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 S3 error |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
For S3 errors exception it raises is instance of C<Net::Amazon::S3::X::error-code>. |
46
|
|
|
|
|
|
|
AWS error code list can be found at L<https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList> |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $s3 = Net::Amazon::S3->new ( |
49
|
|
|
|
|
|
|
error_handler_class => 'Net::Amazon::S3::Error::Handler::X', |
50
|
|
|
|
|
|
|
... |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
eval { do s3 operation; 1 } or do { |
54
|
|
|
|
|
|
|
say 'access denied' |
55
|
|
|
|
|
|
|
if $@->$Safe::Isa::_isa ('Net::Amazon::S3::X::AccessDenied'); |
56
|
|
|
|
|
|
|
... |
57
|
|
|
|
|
|
|
}; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 AUTHOR |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Branislav Zahradník <barney@cpan.org> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
68
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |