RFR: 8368249: HttpClient: Translate exceptions thrown by sendAsync [v3]
Daniel Fuchs
dfuchs at openjdk.org
Wed Oct 15 13:52:42 UTC 2025
On Tue, 14 Oct 2025 09:11:19 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:
>> Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>>
>> - Merge remote-tracking branch 'upstream/master' into sendAsyncExWrap
>> - Use `Utils::getCompletionCause`
>>
>> Co-authored-by: Daniel Fuchs <67001856+dfuch at users.noreply.github.com>
>> - Document exception wrapping in `HttpClientImpl::send`
>> - Fix test failures
>> - Ensure `sendAsync` wraps execution failures in `IOException`
>
> test/jdk/java/net/httpclient/http3/StopSendingTest.java line 184:
>
>> 182: }
>> 183:
>> 184: private static boolean throwableCausalChainContainsInstanceOf(
>
> `HttpClientImpl::send` wraps `IOException` (wrapping `CancellationException`) thrown by `sendAsync` in an `IOException` again. As a result, the existing checks performing _"unwrapping of `IOException` once"_ do not work anymore. Since the existing unwrapping was not strict – that is, they're not enforced, but optionally unwrapping if types match in the causal chain – I've further relaxed it with scanning the causal chain.
We don't want to wrap CancellationException. That's a valid exception for any CompletableFuture to throw.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27787#discussion_r2432648591
More information about the net-dev
mailing list