RFR: 8368249: HttpClient: Translate exceptions thrown by sendAsync [v3]

Daniel Fuchs dfuchs at openjdk.org
Wed Oct 15 13:49:24 UTC 2025


On Tue, 14 Oct 2025 09:05:54 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/InvalidInputStreamSubscriptionRequest.java line 476:
> 
>> 474:     }
>> 475: 
>> 476:     private static boolean throwableCausalChainContainsInstanceOf(
> 
> `HttpClientImpl::send` wraps `IOException` (wrapping `IllegalArgumentException`) 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.

I wonder if we should add the wrapping only when sendAsync is not called by send?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27787#discussion_r2432636766


More information about the net-dev mailing list