David Reiss | 7f42bcf | 2008-01-11 20:59:12 +0000 | [diff] [blame^] | 1 | using System; |
| 2 | using System.Collections.Generic; |
| 3 | using System.Linq; |
| 4 | using System.Text; |
| 5 | |
| 6 | namespace 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 | } |