You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2017/08/17 21:39:09 UTC

httpcomponents-core git commit: Add a meaningful exception message when a timeout occurs.

Repository: httpcomponents-core
Updated Branches:
  refs/heads/4.4.x 8db8525f6 -> f826f1d38


Add a meaningful exception message when a timeout occurs.

Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/f826f1d3
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/f826f1d3
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/f826f1d3

Branch: refs/heads/4.4.x
Commit: f826f1d38aecd52c30b1f5e71bea037588903afc
Parents: 8db8525
Author: Gary Gregory <ga...@gmail.com>
Authored: Thu Aug 17 15:39:06 2017 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Thu Aug 17 15:39:06 2017 -0600

----------------------------------------------------------------------
 .../org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f826f1d3/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
index d4f84d1..3ef4e7d 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
@@ -375,7 +375,8 @@ public class HttpAsyncRequestExecutor implements NHttpClientEventHandler {
             state.invalidate();
             final HttpAsyncClientExchangeHandler handler = getHandler(conn);
             if (handler != null) {
-                handler.failed(new SocketTimeoutException());
+                handler.failed(new SocketTimeoutException(
+                        String.format("%,d milliseconds timeout on connection %s", conn.getSocketTimeout(), conn)));
                 handler.close();
             }
         }