--- a/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java Fri Jun 22 18:19:26 2018 +0200
+++ b/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java Fri Jun 22 18:10:20 2018 +0100
@@ -54,6 +54,7 @@
import sun.net.NetHooks;
import sun.net.ext.ExtendedSocketOptions;
+import sun.net.util.SocketExceptions;
import static sun.net.ext.ExtendedSocketOptions.SOCK_STREAM;
/**
@@ -706,7 +707,7 @@
} catch (IOException ioe) {
// connect failed, close the channel
close();
- throw ioe;
+ throw SocketExceptions.of(ioe, isa);
}
}
@@ -792,7 +793,7 @@
} catch (IOException ioe) {
// connect failed, close the channel
close();
- throw ioe;
+ throw SocketExceptions.of(ioe, remoteAddress);
}
}