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 26461a8303..f2db2bb7de 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 @@ -212,7 +212,7 @@ public ResponseT performRequest( if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } - throw new IOException(e); + throw new IllegalStateException("unexpected exception type: must be either RuntimeException or IOException", cause); } catch (InterruptedException e) { throw new IOException("HttpRequest was interrupted", e); }