af-fastapi-exceptions 0.0.4__tar.gz → 0.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {af_fastapi_exceptions-0.0.4 → af_fastapi_exceptions-0.0.6}/PKG-INFO +1 -1
- {af_fastapi_exceptions-0.0.4 → af_fastapi_exceptions-0.0.6}/pyproject.toml +1 -1
- {af_fastapi_exceptions-0.0.4 → af_fastapi_exceptions-0.0.6}/src/allfly/fastapi/exceptions/__init__.py +4 -12
- {af_fastapi_exceptions-0.0.4 → af_fastapi_exceptions-0.0.6}/src/allfly/fastapi/exceptions/exceptions.py +9 -0
- {af_fastapi_exceptions-0.0.4 → af_fastapi_exceptions-0.0.6}/README.md +0 -0
- {af_fastapi_exceptions-0.0.4 → af_fastapi_exceptions-0.0.6}/src/allfly/fastapi/exceptions/middleware.py +0 -0
- {af_fastapi_exceptions-0.0.4 → af_fastapi_exceptions-0.0.6}/src/allfly/fastapi/exceptions/py.typed +0 -0
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
from allfly.fastapi.exceptions.exceptions import
|
|
2
|
-
BadRequestError,
|
|
3
|
-
DownstreamServiceError,
|
|
4
|
-
EntityNotFoundError,
|
|
5
|
-
ForbiddenError,
|
|
6
|
-
ResourceConflictError,
|
|
7
|
-
ServiceError,
|
|
8
|
-
ServiceWarning,
|
|
9
|
-
UnauthorizedRequestError,
|
|
10
|
-
UnprocessableRequestError,
|
|
11
|
-
UnsupportedFeatureError,
|
|
12
|
-
)
|
|
1
|
+
from allfly.fastapi.exceptions.exceptions import * # noqa: F401, F403
|
|
13
2
|
from allfly.fastapi.exceptions.middleware import (
|
|
14
3
|
ApiErrorBody,
|
|
15
4
|
DefaultExceptionHandlerSettings,
|
|
@@ -28,8 +17,11 @@ __all__ = [
|
|
|
28
17
|
"ForbiddenError",
|
|
29
18
|
"BadRequestError",
|
|
30
19
|
"EntityNotFoundError",
|
|
20
|
+
"EntityNotFoundWarning",
|
|
31
21
|
"ResourceConflictError",
|
|
22
|
+
"ResourceConflictWarning",
|
|
32
23
|
"UnprocessableRequestError",
|
|
24
|
+
"UnprocessableRequestWarning",
|
|
33
25
|
"UnsupportedFeatureError",
|
|
34
26
|
"DownstreamServiceError",
|
|
35
27
|
"ExceptionMiddleware",
|
|
@@ -54,12 +54,21 @@ class ResourceConflictError(ServiceError):
|
|
|
54
54
|
status_code = status.HTTP_409_CONFLICT
|
|
55
55
|
super().__init__(message, status_code)
|
|
56
56
|
|
|
57
|
+
class ResourceConflictWarning(ServiceWarning):
|
|
58
|
+
def __init__(self, message="Request creates a conflict"):
|
|
59
|
+
status_code = status.HTTP_409_CONFLICT
|
|
60
|
+
super().__init__(message, status_code)
|
|
57
61
|
|
|
58
62
|
class UnprocessableRequestError(ServiceError):
|
|
59
63
|
def __init__(self, message="Unprocessable Request"):
|
|
60
64
|
status_code = status.HTTP_422_UNPROCESSABLE_ENTITY
|
|
61
65
|
super().__init__(message, status_code)
|
|
62
66
|
|
|
67
|
+
class UnprocessableRequestWarning(ServiceWarning):
|
|
68
|
+
def __init__(self, message="Unprocessable Request"):
|
|
69
|
+
status_code = status.HTTP_422_UNPROCESSABLE_ENTITY
|
|
70
|
+
super().__init__(message, status_code)
|
|
71
|
+
|
|
63
72
|
|
|
64
73
|
class UnsupportedFeatureError(ServiceWarning):
|
|
65
74
|
def __init__(self, message="Not implemented"):
|
|
File without changes
|
|
File without changes
|
{af_fastapi_exceptions-0.0.4 → af_fastapi_exceptions-0.0.6}/src/allfly/fastapi/exceptions/py.typed
RENAMED
|
File without changes
|