Use the original stack trace when translating SocketTimeoutException to ConnectTimeoutException

This commit is contained in:
Trustin Lee 2013-03-08 08:40:28 +09:00
parent e66fc219ff
commit 16f4de7adb

View File

@ -201,7 +201,9 @@ public class OioSocketChannel extends OioByteStreamChannel
activate(socket.getInputStream(), socket.getOutputStream());
success = true;
} catch (SocketTimeoutException e) {
throw new ConnectTimeoutException("connection timed out: " + remoteAddress);
ConnectTimeoutException cause = new ConnectTimeoutException("connection timed out: " + remoteAddress);
cause.setStackTrace(e.getStackTrace());
throw cause;
} finally {
if (!success) {
doClose();