diff --git a/java-client/src/main/java/org/opensearch/client/transport/aws/AwsSdk2Transport.java b/java-client/src/main/java/org/opensearch/client/transport/aws/AwsSdk2Transport.java index f2db2bb7de..ad6718ec20 100644 --- a/java-client/src/main/java/org/opensearch/client/transport/aws/AwsSdk2Transport.java +++ b/java-client/src/main/java/org/opensearch/client/transport/aws/AwsSdk2Transport.java @@ -33,8 +33,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.net.ssl.SSLHandshakeException; -import org.apache.hc.client5.http.ConnectTimeoutException; -import org.apache.hc.core5.http.ConnectionClosedException; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.jackson.JacksonJsonpMapper; @@ -635,21 +633,11 @@ private static Exception extractAndWrapCause(Exception exception) { } exception = (Exception) t; } - if (exception instanceof ConnectTimeoutException) { - ConnectTimeoutException e = new ConnectTimeoutException(exception.getMessage()); - e.initCause(exception); - return e; - } if (exception instanceof SocketTimeoutException) { SocketTimeoutException e = new SocketTimeoutException(exception.getMessage()); e.initCause(exception); return e; } - if (exception instanceof ConnectionClosedException) { - ConnectionClosedException e = new ConnectionClosedException(exception.getMessage()); - e.initCause(exception); - return e; - } if (exception instanceof SSLHandshakeException) { SSLHandshakeException e = new SSLHandshakeException( exception.getMessage() + "\nSee https://opensearch.org/docs/latest/clients/java/ for troubleshooting."