NAME

Amazon::API::Error

SYNOPSIS

my $result = eval {
  decode_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 AND SUBROUTINEs

get_error

Returns the HTTP status code returned by the API call.

get_response

Returns a decoded response. Usually 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>

LICENSE AND COPYRIGHT

This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.

AUTHOR

Rob Lauer - <rlauer6@comcast.net>

SEE OTHER

Amazon::API