use of software.amazon.awssdk.core.internal.interceptor.DefaultFailedExecutionContext in project aws-sdk-java-v2 by aws.
the class ExecutionInterceptorChain method modifyException.
public DefaultFailedExecutionContext modifyException(DefaultFailedExecutionContext context, ExecutionAttributes executionAttributes) {
DefaultFailedExecutionContext result = context;
for (int i = interceptors.size() - 1; i >= 0; i--) {
Throwable interceptorResult = interceptors.get(i).modifyException(result, executionAttributes);
validateInterceptorResult(result.exception(), interceptorResult, interceptors.get(i), "modifyException");
result = result.copy(b -> b.exception(interceptorResult));
}
return result;
}
use of software.amazon.awssdk.core.internal.interceptor.DefaultFailedExecutionContext in project aws-sdk-java-v2 by aws.
the class HelpfulUnknownHostExceptionInterceptorTest method modifyException.
private Throwable modifyException(Throwable throwable, Region clientRegion, String serviceEndpointPrefix) {
SdkRequest sdkRequest = Mockito.mock(SdkRequest.class);
DefaultFailedExecutionContext context = DefaultFailedExecutionContext.builder().interceptorContext(InterceptorContext.builder().request(sdkRequest).build()).exception(throwable).build();
ExecutionAttributes executionAttributes = new ExecutionAttributes().putAttribute(AwsExecutionAttribute.AWS_REGION, clientRegion).putAttribute(AwsExecutionAttribute.ENDPOINT_PREFIX, serviceEndpointPrefix);
return INTERCEPTOR.modifyException(context, executionAttributes);
}
Aggregations