From: Bryan Duxbury Date: Tue, 11 Sep 2012 18:33:07 +0000 (+0000) Subject: THRIFT-1655. java: TBinaryProtocol: exceeded message length raises generic TException X-Git-Tag: 0.9.1~312 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=630ce09ae6f8bca0ac456cbdc9984de73e08512c;p=common%2Fthrift.git 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 d0d993b3..0c20fa98 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 @@ public class TBinaryProtocol extends TProtocol { 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); } } }