Amazon::API::Error
my $result = eval { decode_json( $cwe->PutPermission( { Action => "PutEvents", Principal => "123454657889012", StatementId => "12345" } ); }; print Dumper( [ $@->get_response, $@->get_error ] ) if $@ && ref($@) =~ /API::Error/;
Error object that contains that status code and the error message contained in the body of the response to the API call.
Returns the HTTP status code returned by the API call.
Returns a decoded response. Usually a hash.
Returns the content of the body of the error response.
Returns the Content-Type of the response.
Returns the API that was called that generated the error.
An example response:
<?xml version="1.0" encoding="UTF-8"?> <Response><Errors><Error><Code>UnauthorizedOperation</Code><Message>You are not authorized to perform this operation.</Message></Error></Errors><RequestID>599b0f86-4668-4adb-b493-552d6039fcd1</RequestID></Response>
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
Rob Lauer - <rlauer6@comcast.net>
Amazon::API
To install Amazon::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Amazon::API
CPAN shell
perl -MCPAN -e shell install Amazon::API
For more information on module installation, please visit the detailed CPAN module installation guide.