JavaScript is disabled on your browser.
Skip navigation links

AWS SDK for Java 1.x API Reference - 1.12.793

We announced the upcoming end-of-support for AWS SDK for Java (v1). We recommend that you migrate to AWS SDK for Java v2. For dates, additional details, and information on how to migrate, please refer to the linked announcement.
com.amazonaws.http

Class DefaultErrorResponseHandler

  • All Implemented Interfaces:
    HttpResponseHandler<AmazonServiceException>


    public class DefaultErrorResponseHandler
    extends Object
    implements HttpResponseHandler<AmazonServiceException>
    Implementation of HttpResponseHandler that handles only error responses from Amazon Web Services. A list of unmarshallers is passed into the constructor, and while handling a response, each unmarshaller is tried, in order, until one is found that can successfully unmarshall the error response. If no unmarshaller is found that can unmarshall the error response, a generic AmazonServiceException is created and populated with the AWS error response information (error message, AWS error code, AWS request ID, etc).
    • Constructor Detail

      • DefaultErrorResponseHandler

        public DefaultErrorResponseHandler(Map<String,Unmarshaller<AmazonServiceException,Node>> unmarshallerMap,
         Unmarshaller<AmazonServiceException,Node> defaultUnmarshaller)
        Constructs a new DefaultErrorResponseHandler that will handle error responses from Amazon services using the specified map of unmarshallers. Unmrarshallers are retrieved from unmarshallerMap
        Parameters:
        unmarshallerMap - The map of unmarshallers where key is errorCode and Value is unmarshaller for that errorCode.
        defaultUnmarshaller - Default or standard Unmarshaller defined for the Service.
      • DefaultErrorResponseHandler

        public DefaultErrorResponseHandler(List<Unmarshaller<AmazonServiceException,Node>> unmarshallerList)
        Constructs a new DefaultErrorResponseHandler that will handle error responses from Amazon services using the specified list of unmarshallers. Each unmarshaller will be tried, in order, until one is found that can unmarshall the error response.
        Parameters:
        unmarshallerList - The list of unmarshallers to try using when handling an error response.
    • Method Detail

      • handle

        public AmazonServiceException handle(HttpResponse errorResponse)
         throws Exception 
        Description copied from interface: HttpResponseHandler
        Accepts an HTTP response object, and returns an object of type T. Individual implementations may choose to handle the response however they need to, and return any type that they need to.
        Specified by:
        handle in interface HttpResponseHandler<AmazonServiceException>
        Parameters:
        errorResponse - The HTTP response to handle, as received from an AWS service.
        Returns:
        An object of type T, as defined by individual implementations.
        Throws:
        Exception - If any problems are encountered handling the response.
Skip navigation links

AltStyle によって変換されたページ (->オリジナル) /