From d016c310084928c8481c72f5ed5c2cb316308bc7 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 5 Sep 2017 23:17:52 +0200 Subject: Add the timeout in the message too. --- jrt/src/com/yahoo/jrt/InvocationClient.java | 2 +- jrt/tests/com/yahoo/jrt/TimeoutTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'jrt') diff --git a/jrt/src/com/yahoo/jrt/InvocationClient.java b/jrt/src/com/yahoo/jrt/InvocationClient.java index ed95976f546..0b01ea0935b 100644 --- a/jrt/src/com/yahoo/jrt/InvocationClient.java +++ b/jrt/src/com/yahoo/jrt/InvocationClient.java @@ -89,7 +89,7 @@ class InvocationClient implements ReplyHandler, Runnable { if (!conn.cancelReply(this)) { return; } - req.setError(ErrorCode.TIMEOUT, "Request timed out"); + req.setError(ErrorCode.TIMEOUT, "Request timed out after " + timeout + " seconds."); reqWaiter.handleRequestDone(req); } } diff --git a/jrt/tests/com/yahoo/jrt/TimeoutTest.java b/jrt/tests/com/yahoo/jrt/TimeoutTest.java index 363ac8cde59..ce9bb954d74 100644 --- a/jrt/tests/com/yahoo/jrt/TimeoutTest.java +++ b/jrt/tests/com/yahoo/jrt/TimeoutTest.java @@ -56,6 +56,7 @@ public class TimeoutTest extends junit.framework.TestCase { assertTrue(req.isError()); assertEquals(ErrorCode.TIMEOUT, req.errorCode()); + assertEquals("Request timed out after 0.1 seconds.", req.errorMessage()); assertEquals(0, req.returnValues().size()); } -- cgit v1.2.3