From e5341192fdd65bd306f1bb46410f09c4674a415f Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Wed, 21 Feb 2007 04:56:26 +0000 Subject: [PATCH] protocol exceptions in java Reviewed By: aditya git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665012 13f79535-47bb-0310-9956-ffa450edef68 --- lib/java/src/protocol/TProtocolException.java | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 lib/java/src/protocol/TProtocolException.java diff --git a/lib/java/src/protocol/TProtocolException.java b/lib/java/src/protocol/TProtocolException.java new file mode 100644 index 00000000..fa172de8 --- /dev/null +++ b/lib/java/src/protocol/TProtocolException.java @@ -0,0 +1,59 @@ +package com.facebook.thrift.protocol; + +import com.facebook.thrift.TException; + +/** + * Protocol exceptions. + * + * @author Mark Slee + */ +public class TProtocolException extends TException { + + public static final int UNKNOWN = 0; + public static final int INVALID_DATA = 1; + public static final int NEGATIVE_SIZE = 2; + public static final int SIZE_LIMIT = 3; + + protected int type_ = UNKNOWN; + + public TProtocolException() { + super(); + } + + public TProtocolException(int type) { + super(); + type_ = type; + } + + public TProtocolException(int type, String message) { + super(message); + type_ = type; + } + + public TProtocolException(String message) { + super(message); + } + + public TProtocolException(int type, Throwable cause) { + super(cause); + type_ = type; + } + + public TProtocolException(Throwable cause) { + super(cause); + } + + public TProtocolException(String message, Throwable cause) { + super(message, cause); + } + + public TProtocolException(int type, String message, Throwable cause) { + super(message, cause); + type_ = type; + } + + public int getType() { + return type_; + } + +} -- 2.17.1