本文整理汇总了Java中com.amazonaws.http.JsonErrorResponseHandler类的典型用法代码示例。如果您正苦于以下问题:Java JsonErrorResponseHandler类的具体用法?Java JsonErrorResponseHandler怎么用?Java JsonErrorResponseHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JsonErrorResponseHandler类属于com.amazonaws.http包,在下文中一共展示了JsonErrorResponseHandler类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createErrorResponseHandler
import com.amazonaws.http.JsonErrorResponseHandler; //导入依赖的package包/类
@Override
public JsonErrorResponseHandler createErrorResponseHandler(
final List<JsonErrorUnmarshaller> errorUnmarshallers, String customErrorCodeFieldName) {
return new JsonErrorResponseHandler(errorUnmarshallers,
getErrorCodeParser(customErrorCodeFieldName),
JsonErrorMessageParser.DEFAULT_ERROR_MESSAGE_PARSER,
jsonFactory);
}
示例2: handleError
import com.amazonaws.http.JsonErrorResponseHandler; //导入依赖的package包/类
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);
}
示例3: stubErrorHandler
import com.amazonaws.http.JsonErrorResponseHandler; //导入依赖的package包/类
protected HttpResponseHandler<AmazonServiceException> stubErrorHandler() throws Exception {
HttpResponseHandler<AmazonServiceException> errorHandler = mock(JsonErrorResponseHandler.class);
when(errorHandler.handle(any(HttpResponse.class))).thenReturn(mockException());
return errorHandler;
}
示例4: invoke
import com.amazonaws.http.JsonErrorResponseHandler; //导入依赖的package包/类
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;
}
示例5: createErrorResponseHandler
import com.amazonaws.http.JsonErrorResponseHandler; //导入依赖的package包/类
/**
* 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);