map AWS_IO_SOCKET_TIMEOUT to java's SocketTimeoutException
Describe the feature
Context
AwsCrtHttpClient returns a generic HttpException that requires looking at the error message to understand the type of error. This is different than ApacheHttpClient which returns specific exception subclassing IOException.
Problem
Use Case
We are upgrading from V1 to V2, and moving from ApacheHttpClient to CrtHttpClient and would like to keep the same functionality on retrying on connection and socket timeouts specifically.
Proposed Solution
On connection failures map AWS_IO_SOCKET_TIMEOUT (ETIMEDOUT) error code to SocketTimeoutException. We are already doing something similar with AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE to SSLHandshakeException.
https://github.com/aws/aws-sdk-java-v2/blob/master/http-clients/aws-crt-client/src/main/java/software/amazon/awssdk/http/crt/internal/CrtUtils.java#L58-L60
Other Information
No response
Acknowledgements
- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
AWS Java SDK version used
2.x
JDK version used
openjdk 17.0.14 2025-01-21 LTS
Operating System and version
AL2
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.