NAME

Amazon::API::Error

SYNOPIS

 my $result = eval {
   from_json($cwe->PutPermission({ Action => "PutEvents", Principal => "123454657889012", StatementId => "12345"});
 };
 
 print Dumper([ $@->get_response, $@->get_error ])
   if $@ && ref($@) =~/API::Error/;

DESCRIPTION

Error object that contains that status code and the error message contained in the body of the response to the API call.

METHODS

get_error

Returns the HTTP status code returned by the API call.

get_response

Returns a decode response. Usuall a hash.

get_message_raw

Returns the content of the body of the error response.

get_content_type

Returns the Content-Type of the response.

get_aws_api

Returns the API that was called that generated the error.

NOTES

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>

AUTHOR

Rob Lauer - <rlauer6@comcast.net>

SEE OTHER

Amazon::API