Amazon::SimpleDB::ErrorResponse - a class representing an


Amazon-SimpleDB documentation Contained in the Amazon-SimpleDB distribution.

Index


Code Index:

NAME

Top

Amazon::SimpleDB::ErrorResponse - a class representing an error response from the SimpleDB service.

DESCRIPTION

Top

This is code is in the early stages of development. Do not consider it stable. Feedback and patches welcome.

This is a subclass Amazon::SimpleDB::Response. See its manpage for more.

METHODS

Top

Amazon::SimpleDB::ErrorResponse->new($args)

Constructor. It is recommended that you use Amazon::SimpleDB::Response-new($http_response)> instead of calling this directly. It will determine if request ended in an error from SimpleDB and will construct an object out of this class.

$res->code

Returns the SimpleDB error code (a string). See the SimpleDB documentation for a list of all error codes.

$res->message

Returns a human-readable message describing the error.

SEE ALSO

Top

Amazon::SimpleDB::Response

AUTHOR & COPYRIGHT

Top


Amazon-SimpleDB documentation Contained in the Amazon-SimpleDB distribution.

package Amazon::SimpleDB::ErrorResponse;
use strict;
use warnings;

use base 'Amazon::SimpleDB::Response';

# can multiple errors happen in one response?

sub new {
    my $self = shift;
    $self->SUPER::new(@_);
    $self->{'request_id'} = $self->{content}->{Response}{RequestID};
    $self->{'box_usage'}  =
      $self->{content}->{Response}{Errors}{Error}{BoxUsage};
    return $self;
}

sub code    { return $_[0]->{content}->{Response}{Errors}{Error}{Code} }
sub message { return $_[0]->{content}->{Response}{Errors}{Error}{Message} }

1;

__END__