Skip to content

Commit

Permalink
Keep the cause when sending ConnectException
Browse files Browse the repository at this point in the history
  • Loading branch information
Tolriq authored and squarejesse committed Sep 27, 2016
1 parent 59e70da commit e7d74f4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ private void connectSocket(int connectTimeout, int readTimeout) throws IOExcepti
try {
Platform.get().connectSocket(rawSocket, route.socketAddress(), connectTimeout);
} catch (ConnectException e) {
throw new ConnectException("Failed to connect to " + route.socketAddress());
ConnectException ce = new ConnectException("Failed to connect to " + route.socketAddress());
ce.initCause(e);
throw ce;
}
source = Okio.buffer(Okio.source(rawSocket));
sink = Okio.buffer(Okio.sink(rawSocket));
Expand Down

0 comments on commit e7d74f4

Please sign in to comment.