Class: Amazon::MWS::RequestTimeout

Inherits:
ResponseError show all
Defined in:
lib/amazon/mws/exceptions.rb

Overview

All responses with a code between 300 and 599 that contain an <Error></Error> body are wrapped in an ErrorResponse which contains an Error object. This Error class generates a custom exception with the name of the xml Error and its message. All such runtime generated exception classes descend from ResponseError and contain the ErrorResponse object so that all code that makes a request can rescue ResponseError and get access to the ErrorResponse. class ResponseError < MWSException

def initialize(formatted_response)
  instance_eval("    def request_id\n      '\#{formatted_response[\"RequestID\"]}'\n    end\n  EVAL\n\n  formatted_response[\"Error\"].each do |key, value|\n    instance_eval(<<-EVAL, __FILE__, __LINE__)\n      def \#{key.underscore}\n        '\#{value}'\n      end\n    EVAL\n  end\nend\n", __FILE__, __LINE__)

end

Method Summary

Methods inherited from Response

#accessors, format, parse_xml