From: Mark Slee Date: Wed, 21 Feb 2007 04:56:26 +0000 (+0000) Subject: protocol exceptions in java X-Git-Tag: 0.2.0~1460 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=e5341192fdd65bd306f1bb46410f09c4674a415f;p=common%2Fthrift.git 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 --- 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_; + } + +}