RFR: JDK-8299475: Enhance SocketException by cause where it is missing in net and nio area [v2]
Matthias Baesken
mbaesken at openjdk.org
Tue Jan 3 08:32:49 UTC 2023
On Tue, 3 Jan 2023 08:29:13 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> We have a couple of places where a SocketException is thrown but the cause is omitted. It would be beneficial for example in error analysis not to throw away the cause (causing exception) but to add it to the created SocketException.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>
> do not enhance some internal exceptions
Hi Alan, I removed the InterruptedIOException enhancement .
Regarding the ConnectionResetException in NioSocketImpl.java, it is not so bad to know what tryRead caused it. So why not add it ?
Additionally we could also add the errno (EPIPE or ECONNRESET) to the exception message to get a better picture of the error situation (see java.base/unix/native/libnio/ch/SocketDispatcher.c ).
-------------
PR: https://git.openjdk.org/jdk/pull/11813
More information about the nio-dev
mailing list