Java 类com.amazonaws.http.JsonErrorResponseHandler 实例源码

项目:ibm-cos-sdk-java    文件:SdkStructuredJsonFactoryImpl.java   
@Override
public JsonErrorResponseHandler createErrorResponseHandler(
        final List<JsonErrorUnmarshaller> errorUnmarshallers, String customErrorCodeFieldName) {
    return new JsonErrorResponseHandler(errorUnmarshallers,
                                        getErrorCodeParser(customErrorCodeFieldName),
                                        JsonErrorMessageParser.DEFAULT_ERROR_MESSAGE_PARSER,
                                        jsonFactory);
}
项目:ibm-cos-sdk-java    文件:SdkStructuredIonFactoryTest.java   
private AmazonServiceException handleError(HttpResponse error) throws Exception {
    List<JsonErrorUnmarshaller> unmarshallers = new LinkedList<JsonErrorUnmarshaller>();
    unmarshallers.add(new JsonErrorUnmarshaller(InvalidParameterException.class, ERROR_TYPE));

    JsonErrorResponseHandler handler = SdkStructuredIonFactory.SDK_ION_BINARY_FACTORY.createErrorResponseHandler(unmarshallers, NO_CUSTOM_ERROR_CODE_FIELD_NAME);
    return handler.handle(error);
}
项目:ibm-cos-sdk-java    文件:WireMockTestBase.java   
protected HttpResponseHandler<AmazonServiceException> stubErrorHandler() throws Exception {
    HttpResponseHandler<AmazonServiceException> errorHandler = mock(JsonErrorResponseHandler.class);
    when(errorHandler.handle(any(HttpResponse.class))).thenReturn(mockException());
    return errorHandler;
}
项目:ivona-speechcloud-sdk-java    文件:IvonaSpeechCloudClient.java   
private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(
        Request<Y> request,
        HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
        ExecutionContext executionContext) {

    JsonErrorResponseHandler errorResponseHandler = new JsonErrorResponseHandler(exceptionUnmarshallers);

    Response<X> result = client.execute(
            prepareRequest(request, executionContext),
            responseHandler,
            errorResponseHandler,
            executionContext);

    return result;
}
项目:ibm-cos-sdk-java    文件:SdkStructuredJsonFactory.java   
/**
 * Returns the error response handler for handling a error response.
 *
 * @param errorUnmarshallers Response unmarshallers to unamrshall the error responses.
 */
JsonErrorResponseHandler createErrorResponseHandler(
        List<JsonErrorUnmarshaller> errorUnmarshallers, String customErrorCodeFieldName);