RFR: 8296410: HttpClient throws java.io.IOException: no statuscode in response for HTTP2 [v2]
Conor Cleary
ccleary at openjdk.org
Thu Feb 9 12:24:46 UTC 2023
On Wed, 8 Feb 2023 12:28:10 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> Conor Cleary 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 eight additional commits since the last revision:
>>
>> - Merge branch 'JDK-8296410' of https://github.com/c-cleary/jdk into JDK-8296410
>> - 8296410: Updated copyright header
>> - 8296410: Use empty trailers instead of sample ones
>> - 8296410: HttpClient throws java.io.IOException: no statuscode in response for HTTP2
>> - 8296410: Made test compatible with new test library structure
>> - Merge branch 'master' of https://github.com/c-cleary/jdk into JDK-8296410
>> - 8296410: Push Promise Test Case Modifications
>> - 8296410: HttpClient throws java.io.IOException: no statuscode in response for HTTP2
>
> test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http2/Http2TestServerConnection.java line 966:
>
>> 964:
>> 965: @Override
>> 966: protected void sendEndStream() {
>
> The method signature of `BodyOutputStream`'s `sendEndStream()` method allows for `IOException` to be thrown. So I think we should just do the same here (i.e. `protected void sendEndStream() throws IOException`). That way you can remove the try/catch block in this method which currently just prints the exception stacktrace. The caller can then decide what to do with that exception, which in the current case, the `BodyOutputStream` just logs.
Agreed, well spotted. Much nicer to have it as `protected void sendEndStream() throws IOException`.
-------------
PR: https://git.openjdk.org/jdk/pull/12028
More information about the net-dev
mailing list