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