1quick_error!{
2 #[derive(Debug, PartialEq, Eq)]
3 pub enum DecodeErr{
4 NoEnoughDataErr{
5 description("decoder: without enough data to read")
6 }
7 UnknownTarsTypeErr{
8 description("decoder: unknown tars type")
9 }
10 TarsTagNotFoundErr{
11 description("decoder: Tag Not Found")
12 }
13 MisMatchTarsTypeErr {
14 description("decoder: mismatch type")
15 }
16 WrongSimpleListTarsTypeErr {
17 description("decoder: wrong simple list type")
18 }
19 InvalidEnumValue {
20 description("decoder: invalid enum value")
21 }
22 FieldNotFoundErr(desc: String) {
23 description(desc)
24 }
25 TypeNotFoundErr(desc: String) {
26 description(desc)
27 }
28 TupKeyNotFoundErr {
29 description("decoder: Tup Key Not Found")
30 }
31 UnsupportTupVersionErr {
32 description("decoder: Unsupport protocol version")
33 }
34 }
35}
36
37quick_error!{
38 #[derive(Debug, PartialEq, Eq)]
39 pub enum TarsTypeErr{
40 DisMatchTarsTypeErr{
41 description("tars_type: disMatch tars_type")
42 }
43 }
44}
45
46quick_error!{
47 #[derive(Debug, PartialEq, Eq)]
48 pub enum EncodeErr{
49 TooBigTagErr{
50 description("encoder: tag too big, max value is 255")
51 }
52 ConvertU8Err{
53 description("encoder: cannot convert to u8")
54 }
55 DataTooBigErr {
56 description("encoder: data bigger than 4294967295 bytes")
57 }
58 UnknownTarsTypeErr{
59 description("encoder: unknown tars type")
60 }
61 UnsupportTupVersionErr {
62 description("encoder: Unsupport protocol version")
63 }
64 }
65}