Skip to content

Commit ef8154c

Browse files
Address PR Comments
1 parent fb1a6b1 commit ef8154c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

.changes/next-release/bugfix-UrlConnectionClient-4dd3b0c.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"type": "bugfix",
33
"category": "Url Connection Client",
44
"contributor": "",
5-
"description": "Handle unhandled NullPointerException wrapped in RuntimeException when underlying connection fails with URL Connection HTTP Client"
5+
"description": "Wrap NullPointerException wrapped in RuntimeException as IOException to allow retry when underlying connection fails with URL Connection HTTP Client"
66
}

http-clients/url-connection-client/src/main/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ private <T> Optional<T> getAndHandle100Bug(Supplier<T> supplier, boolean failOn1
368368
} catch (RuntimeException e) {
369369
if (e.getCause() instanceof NullPointerException) {
370370
throw new UncheckedIOException(new IOException(
371-
"Unexpected RuntimeException wrapping NullPointerException from HttpURLConnection", e));
371+
"Unexpected NullPointerException when calling HttpURLConnection", e));
372372
}
373373

374374
if (!exceptionCausedBy100HandlingBug(e)) {
@@ -438,8 +438,8 @@ private static int getResponseCodeSafely(HttpURLConnection connection) throws IO
438438
throw new IOException("Unexpected NullPointerException when trying to read response from HttpURLConnection", e);
439439
} catch (RuntimeException e) {
440440
if (e.getCause() instanceof NullPointerException) {
441-
throw new IOException("Unexpected RuntimeException wrapping NullPointerException when trying to "
442-
+ "read response from HttpURLConnection", e);
441+
throw new IOException("Unexpected NullPointerException when trying to read response from "
442+
+ "HttpURLConnection", e);
443443
}
444444
throw e;
445445
}

0 commit comments

Comments
 (0)