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