-
Notifications
You must be signed in to change notification settings - Fork 19
/
exceptions.py
35 lines (26 loc) · 827 Bytes
/
exceptions.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
class TransmuteCoreException(Exception):
"""base exception"""
class APIException(TransmuteCoreException):
"""
this exception signifies an exception
with API
"""
def __init__(self, message, code=400):
"""code can be overriden, to allow the proper status code."""
super(APIException, self).__init__(message)
self.code = code
class SerializationException(APIException):
"""
this exceptions signifies an exception with
serializing values.
"""
class NoSerializerFound(TransmuteCoreException):
"""
raised when a serializer does not exist to handle the
desired content type.
"""
class InvalidTransmuteDefinition(TransmuteCoreException):
"""
this exception is raised when an invalid configuration for
transmute is encountered
"""