File Coverage

blib/lib/Net/Amazon/S3/Error/Handler/Status.pm
Criterion Covered Total %
statement 10 10 100.0
branch 2 2 100.0
condition n/a
subroutine 2 2 100.0
pod 1 1 100.0
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Net::Amazon::S3::Error::Handler::Status;
2             $Net::Amazon::S3::Error::Handler::Status::VERSION = '0.99';
3             # ABSTRACT: An internal class to report response errors via err properties
4              
5 99     99   63338 use Moose;
  99         316  
  99         3314  
6              
7             extends 'Net::Amazon::S3::Error::Handler';
8              
9             sub handle_error {
10 82     82 1 1090 my ($self, $response) = @_;
11              
12 82         2985 $self->s3->err (undef);
13 82         2425 $self->s3->errstr (undef);
14              
15 82 100       573 return 1 unless $response->is_error;
16              
17 42         1769 $self->s3->err ($response->error_code);
18 42         1379 $self->s3->errstr ($response->error_message);
19              
20 42         261 return 0;
21             }
22              
23             1;
24              
25             __END__
26              
27             =pod
28              
29             =encoding UTF-8
30              
31             =head1 NAME
32              
33             Net::Amazon::S3::Error::Handler::Status - An internal class to report response errors via err properties
34              
35             =head1 VERSION
36              
37             version 0.99
38              
39             =head1 DESCRIPTION
40              
41             Propagate error code and error message via connection's C<err> / C<errstr>
42             methods.
43              
44             =head1 AUTHOR
45              
46             Branislav ZahradnĂ­k <barney@cpan.org>
47              
48             =head1 COPYRIGHT AND LICENSE
49              
50             This software is copyright (c) 2021 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav ZahradnĂ­k.
51              
52             This is free software; you can redistribute it and/or modify it under
53             the same terms as the Perl 5 programming language system itself.
54              
55             =cut