You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dc...@apache.org on 2019/10/09 08:27:32 UTC
[thrift] branch master updated: THRIFT-4858: Add error message to
TTransportException
This is an automated email from the ASF dual-hosted git repository.
dcelasun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git
The following commit(s) were added to refs/heads/master by this push:
new 904f561 THRIFT-4858: Add error message to TTransportException
904f561 is described below
commit 904f5619a9df6a8a3ac8f830e4dab7148c2d7777
Author: wineandcheeze <qi...@users.noreply.github.com>
AuthorDate: Wed Oct 9 10:27:23 2019 +0200
THRIFT-4858: Add error message to TTransportException
When the socket is closed (EOF of the inputstream), currently
TIOStreamTransport throws an TTransportException without message,
this is sometimes confusing for people maintaining a thrift server
(eg. apache hive).
Client: java
This closes #1876.
---
lib/java/src/org/apache/thrift/transport/TIOStreamTransport.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/java/src/org/apache/thrift/transport/TIOStreamTransport.java b/lib/java/src/org/apache/thrift/transport/TIOStreamTransport.java
index c8cd118..93b051f 100644
--- a/lib/java/src/org/apache/thrift/transport/TIOStreamTransport.java
+++ b/lib/java/src/org/apache/thrift/transport/TIOStreamTransport.java
@@ -129,7 +129,7 @@ public class TIOStreamTransport extends TTransport {
throw new TTransportException(TTransportException.UNKNOWN, iox);
}
if (bytesRead < 0) {
- throw new TTransportException(TTransportException.END_OF_FILE);
+ throw new TTransportException(TTransportException.END_OF_FILE, "Socket is closed by peer.");
}
return bytesRead;
}