-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexception.py
58 lines (30 loc) · 1.4 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
57
58
class CherryException(Exception):
"""Base exception for Cherry orm."""
class DatabaseNoBoundError(RuntimeError, CherryException):
"""Database is not bound."""
class ModelMissingError(ValueError, CherryException):
"""Model is missing."""
class ModelTypeError(TypeError, CherryException):
"""Model is not correct."""
class FieldTypeError(TypeError, CherryException):
"""Field type is not correct."""
class RelationSolveError(TypeError, CherryException):
"""Relation is not correct."""
class AbstractModelError(ValueError, CherryException):
"""The model is abstract."""
class PrimaryKeyMissingError(ValueError, CherryException):
"""Primary key is missing."""
class PrimaryKeyMultipleError(ValueError, CherryException):
"""Primary key is multiple."""
class ForeignKeyMissingError(ValueError, CherryException):
"""Foreign key is missing."""
class RelatedFieldMissingError(ValueError, CherryException):
"""Related field is missing."""
class MultipleDataError(ValueError, CherryException):
"""The query returned multiple datas when only one was expected."""
class NoMatchDataError(ValueError, CherryException):
"""The query returned no data when one was expected."""
class PaginateArgError(ValueError, CherryException):
"""The paginate args is not correct."""
class ClauseTypeError(TypeError, CherryException):
"""The clause type is not correct."""