forked from dpgaspar/Flask-AppBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexceptions.py
60 lines (35 loc) · 1.23 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from typing import Optional
class FABException(Exception):
"""Base FAB Exception"""
def __init__(self, *args, exception: Optional[Exception] = None) -> None:
self.exception = exception
super().__init__(*args)
def __str__(self):
return (
f"{self.__class__.__name__}: {self.exception.__class__.__name__}"
if self.exception
else super().__str__()
)
class InvalidColumnFilterFABException(FABException):
"""Invalid column for filter"""
...
class InvalidOperationFilterFABException(FABException):
"""Invalid operation for filter"""
...
class InvalidOrderByColumnFABException(FABException):
"""Invalid order by column"""
...
class InterfaceQueryWithoutSession(FABException):
"""You need to setup a session on the interface to perform queries"""
...
class PasswordComplexityValidationError(FABException):
"""Raise this when implementing your own password complexity function"""
...
class ApplyFilterException(FABException):
"""When executing an apply filter a SQLAlchemy exception happens"""
...
class OAuthProviderUnknown(FABException):
"""
When an OAuth provider is not supported/unknown
"""
...