THRIFT-1655. java: TBinaryProtocol: exceeded message length raises generic TException
This patch converts the TException into a TProtocolException.
Patch: Tyler Hobbs
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1383515 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java b/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java
index d0d993b..0c20fa9 100644
--- a/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java
+++ b/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java
@@ -385,12 +385,12 @@
protected void checkReadLength(int length) throws TException {
if (length < 0) {
- throw new TException("Negative length: " + length);
+ throw new TProtocolException("Negative length: " + length);
}
if (checkReadLength_) {
readLength_ -= length;
if (readLength_ < 0) {
- throw new TException("Message length exceeded: " + length);
+ throw new TProtocolException("Message length exceeded: " + length);
}
}
}