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 0 1 0.0
total 14 15 93.3


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.98';
3             # ABSTRACT: An internal class to report response errors via err properties
4              
5 96     96   64901 use Moose;
  96         266  
  96         2831  
6              
7             extends 'Net::Amazon::S3::Error::Handler';
8              
9             sub handle_error {
10 82     82 0 1104 my ($self, $response) = @_;
11              
12 82         2964 $self->s3->err (undef);
13 82         2395 $self->s3->errstr (undef);
14              
15 82 100       635 return 1 unless $response->is_error;
16              
17 42         1658 $self->s3->err ($response->error_code);
18 42         1348 $self->s3->errstr ($response->error_message);
19              
20 42         266 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.98
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