Example usage for com.amazonaws.http DefaultErrorResponseHandler DefaultErrorResponseHandler

List of usage examples for com.amazonaws.http DefaultErrorResponseHandler DefaultErrorResponseHandler

Introduction

In this page you can find the example usage for com.amazonaws.http DefaultErrorResponseHandler DefaultErrorResponseHandler.

Prototype

public DefaultErrorResponseHandler(List<Unmarshaller<AmazonServiceException, Node>> unmarshallerList) 

Source Link

Document

Constructs a new DefaultErrorResponseHandler that will handle error responses from Amazon services using the specified list of unmarshallers.

Usage

From source file:com.github.sjones4.youcan.youare.YouAreClient.java

License:Open Source License

private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(final Request<Y> request,
        final Unmarshaller<X, StaxUnmarshallerContext> unmarshaller, final ExecutionContext executionContext) {
    request.setEndpoint(endpoint);//w  w  w  .  j  ava 2  s. co m
    request.setTimeOffset(timeOffset);

    executionContext.setCredentialsProvider(
            CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));

    StaxResponseHandler<X> responseHandler = new StaxResponseHandler<X>(unmarshaller);
    DefaultErrorResponseHandler errorResponseHandler = new DefaultErrorResponseHandler(exceptionUnmarshallers);
    return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}