From 8c9c8bf8f0dcaa89a3ca73695442c4f3ccd6e342 Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Wed, 27 Oct 2010 23:15:35 +0000 Subject: [PATCH] THRIFT-517. java:TExceptions thrown by server result in cryptic error message on client - Tried to read 4 bytes, but only got 0 bytes This tiny change improves the message to make it marginally more obvious that the server-side might be the culprit. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1028131 13f79535-47bb-0310-9956-ffa450edef68 --- lib/java/src/org/apache/thrift/transport/TTransport.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/java/src/org/apache/thrift/transport/TTransport.java b/lib/java/src/org/apache/thrift/transport/TTransport.java index 378efdc3..c4086ba2 100644 --- a/lib/java/src/org/apache/thrift/transport/TTransport.java +++ b/lib/java/src/org/apache/thrift/transport/TTransport.java @@ -83,7 +83,12 @@ public abstract class TTransport { while (got < len) { ret = read(buf, off+got, len-got); if (ret <= 0) { - throw new TTransportException("Cannot read. Remote side has closed. Tried to read " + len + " bytes, but only got " + got + " bytes."); + throw new TTransportException( + "Cannot read. Remote side has closed. Tried to read " + + len + + " bytes, but only got " + + got + + " bytes. (This is often indicative of an internal error on the server side. Please check your server logs.)"); } got += ret; } -- 2.17.1