-
Notifications
You must be signed in to change notification settings - Fork 1
/
exception.py
56 lines (36 loc) · 1.24 KB
/
exception.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class SerializerException(Exception):
"""Parent Exception for all Exceptions raised by the
Serializer class.
"""
pass
class MessageNameTooLongException(SerializerException):
"""Exception for when the name of a message is too long,
ergo longer than 20 characters.
"""
pass
class UnknownMessageException(SerializerException):
"""Exception for when a message of unknown name is to be
serialized. Probably a programmer typo.
"""
pass
class FieldTooLongException(SerializerException):
"""Exception for when the amount of bytes used by serialized
data surpasses the allowed amount of bytes.
"""
pass
class FieldNotDefinedException(SerializerException):
"""Exception for when a field definition is not supplied
when serializing.
"""
pass
class FieldWrongTypeException(SerializerException):
"""Exception for when the type of the serialized object
does not match the definition in the Protobuf message.
"""
pass
class FieldLengthUnsupportedException(SerializerException):
"""Exception for when the length option is forced upon a type
which does not support it. Only string, int and long are
supported.
"""
pass