hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject httpcomponents-core git commit: Add a meaningful exception message when a timeout occurs.
Date Thu, 17 Aug 2017 21:39:09 GMT
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 <garydgregory@gmail.com>
Authored: Thu Aug 17 15:39:06 2017 -0600
Committer: Gary Gregory <garydgregory@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();
             }
         }


Mime
View raw message