From 630ce09ae6f8bca0ac456cbdc9984de73e08512c Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Tue, 11 Sep 2012 18:33:07 +0000 Subject: [PATCH] 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 --- lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } } } -- 2.17.1