本文整理汇总了Java中com.amazonaws.AmazonServiceException.setServiceName方法的典型用法代码示例。如果您正苦于以下问题:Java AmazonServiceException.setServiceName方法的具体用法?Java AmazonServiceException.setServiceName怎么用?Java AmazonServiceException.setServiceName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.AmazonServiceException
的用法示例。
在下文中一共展示了AmazonServiceException.setServiceName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handle
import com.amazonaws.AmazonServiceException; //导入方法依赖的package包/类
@Override
public AmazonServiceException handle(HttpResponse response) throws Exception {
JsonContent jsonContent = JsonContent.createJsonContent(response, jsonFactory);
String errorCode = errorCodeParser.parseErrorCode(response, jsonContent);
AmazonServiceException ase = createException(errorCode, jsonContent);
// Jackson has special-casing for 'message' values when deserializing
// Throwables, but sometimes the service passes the error message in
// other JSON fields - handle it here.
if (ase.getErrorMessage() == null) {
ase.setErrorMessage(errorMessageParser.parseErrorMessage(response, jsonContent.getJsonNode()));
}
ase.setErrorCode(errorCode);
ase.setServiceName(response.getRequest().getServiceName());
ase.setStatusCode(response.getStatusCode());
ase.setErrorType(getErrorTypeFromStatusCode(response.getStatusCode()));
ase.setRawResponse(jsonContent.getRawContent());
String requestId = getRequestIdFromHeaders(response.getHeaders());
if (requestId != null) {
ase.setRequestId(requestId);
}
ase.setHttpHeaders(response.getHeaders());
return ase;
}
示例2: handle
import com.amazonaws.AmazonServiceException; //导入方法依赖的package包/类
@Override
public AmazonServiceException handle(HttpResponse response) throws Exception {
final AmazonServiceException ase = handleAse(response);
ase.setStatusCode(response.getStatusCode());
ase.setServiceName(response.getRequest().getServiceName());
awsRequestMetrics.addPropertyWith(AWSRequestMetrics.Field.AWSRequestID, ase.getRequestId())
.addPropertyWith(AWSRequestMetrics.Field.AWSErrorCode, ase.getErrorCode())
.addPropertyWith(AWSRequestMetrics.Field.StatusCode, ase.getStatusCode());
return ase;
}