THRIFT-517. java:TExceptions thrown by server result in cryptic error message on...
authorBryan Duxbury <bryanduxbury@apache.org>
Wed, 27 Oct 2010 23:15:35 +0000 (23:15 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Wed, 27 Oct 2010 23:15:35 +0000 (23:15 +0000)
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

index 378efdc..c4086ba 100644 (file)
@@ -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;
     }