blob: efc54b48e3756d9dcaa0f189ef56f522011ffa4c [file] [log] [blame]
Mark Slee7eb0d632007-03-01 00:00:27 +00001// Copyright (c) 2006- Facebook
2// Distributed under the Thrift Software License
3//
4// See accompanying file LICENSE or visit the Thrift site at:
5// http://developers.facebook.com/thrift/
6
Mark Sleee5341192007-02-21 04:56:26 +00007package com.facebook.thrift.protocol;
8
9import com.facebook.thrift.TException;
10
11/**
12 * Protocol exceptions.
13 *
14 * @author Mark Slee <mcslee@facebook.com>
15 */
16public class TProtocolException extends TException {
17
18 public static final int UNKNOWN = 0;
19 public static final int INVALID_DATA = 1;
20 public static final int NEGATIVE_SIZE = 2;
21 public static final int SIZE_LIMIT = 3;
22
23 protected int type_ = UNKNOWN;
24
25 public TProtocolException() {
26 super();
27 }
28
29 public TProtocolException(int type) {
30 super();
31 type_ = type;
32 }
33
34 public TProtocolException(int type, String message) {
35 super(message);
36 type_ = type;
37 }
38
39 public TProtocolException(String message) {
40 super(message);
41 }
42
43 public TProtocolException(int type, Throwable cause) {
44 super(cause);
45 type_ = type;
46 }
47
48 public TProtocolException(Throwable cause) {
49 super(cause);
50 }
51
52 public TProtocolException(String message, Throwable cause) {
53 super(message, cause);
54 }
55
56 public TProtocolException(int type, String message, Throwable cause) {
57 super(message, cause);
58 type_ = type;
59 }
60
61 public int getType() {
62 return type_;
63 }
64
65}