blob: f43a7ccb9004e2091c90af282d34682e995cee60 [file] [log] [blame]
David Reiss7f42bcf2008-01-11 20:59:12 +00001using System;
David Reiss7f42bcf2008-01-11 20:59:12 +00002
3namespace Thrift.Protocol
4{
5 class TProtocolException : Exception
6 {
7 public const int UNKNOWN = 0;
8 public const int INVALID_DATA = 1;
9 public const int NEGATIVE_SIZE = 2;
10 public const int SIZE_LIMIT = 3;
11 public const int BAD_VERSION = 4;
12
13 protected int type_ = UNKNOWN;
14
15 public TProtocolException()
16 : base()
17 {
18 }
19
20 public TProtocolException(int type)
21 : base()
22 {
23 type_ = type;
24 }
25
26 public TProtocolException(int type, String message)
27 : base(message)
28 {
29 type_ = type;
30 }
31
32 public TProtocolException(String message)
33 : base(message)
34 {
35 }
36
37 public int getType()
38 {
39 return type_;
40 }
41 }
42}