Class TimeoutExceptionHandlingStage<OutputT>
java.lang.Object
software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage<OutputT>
- All Implemented Interfaces:
RequestPipeline<SdkHttpFullRequest,,Response<OutputT>> RequestToResponsePipeline<OutputT>
@SdkInternalApi
public final class TimeoutExceptionHandlingStage<OutputT>
extends Object
implements RequestToResponsePipeline<OutputT>
Check if an
Exception is caused by either ApiCallTimeout or ApiAttemptTimeout and translate that
exception to a more appropriate timeout related exception so that it can be handled in other stages.-
Constructor Summary
ConstructorsConstructorDescriptionTimeoutExceptionHandlingStage(HttpClientDependencies dependencies, RequestPipeline<SdkHttpFullRequest, Response<OutputT>> requestPipeline) -
Method Summary
Modifier and TypeMethodDescriptionexecute(SdkHttpFullRequest request, RequestExecutionContext context) Translate anExceptioncaused by timeout based on the following criteria: If theExceptionis caused byClientOverrideConfiguration.apiCallTimeout(), translates it toInterruptedExceptionso it can be handled appropriately inApiCallTimeoutTrackingStage.
-
Constructor Details
-
TimeoutExceptionHandlingStage
public TimeoutExceptionHandlingStage(HttpClientDependencies dependencies, RequestPipeline<SdkHttpFullRequest, Response<OutputT>> requestPipeline)
-
-
Method Details
-
execute
public Response<OutputT> execute(SdkHttpFullRequest request, RequestExecutionContext context) throws Exception Translate anExceptioncaused by timeout based on the following criteria:- If the
Exceptionis caused byClientOverrideConfiguration.apiCallTimeout(), translates it toInterruptedExceptionso it can be handled appropriately inApiCallTimeoutTrackingStage. -
If it is caused by
ClientOverrideConfiguration.apiCallAttemptTimeout(), clear the interrupt status, translates it toApiCallAttemptTimeoutExceptionso that it might be retried inRetryableStage
ApiCallTimeout takes precedence because it is not retryable.
- Specified by:
executein interfaceRequestPipeline<SdkHttpFullRequest,Response<OutputT>> - Parameters:
request- the requestcontext- Context containing both request dependencies, and a container for any mutable state that must be shared between stages.- Returns:
- the response
- Throws:
Exception- the translated exception or the original exception
- If the
-