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:49:49 UTC 2023
On Tue, 3 Jan 2023 08:43:04 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> > 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 ).
>
> sun.net.ConnectionResetException is used to communicate the error from the native code to the socket impl. It's part of an internal contract and never ended to be leak out to user code.
>
> There have been discussions every few yers about introducing a specific SocketException for the "connection reset" scenario and maybe it is time to look at that again.
Hi Alan, do you mean some new class like java/net/SocketConnectionResetException.java (or a more suitable name) ?
-------------
PR: https://git.openjdk.org/jdk/pull/11813
More information about the nio-dev
mailing list