From: Bryan Duxbury Date: Wed, 27 Oct 2010 23:15:35 +0000 (+0000) Subject: THRIFT-517. java:TExceptions thrown by server result in cryptic error message on... X-Git-Tag: 0.6.0~49 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=8c9c8bf8f0dcaa89a3ca73695442c4f3ccd6e342;p=common%2Fthrift.git 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 --- 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; }