spakky-fastapi 2.1.0__py3-none-any.whl → 2.3.0__py3-none-any.whl

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.
spakky_fastapi/error.py CHANGED
@@ -15,7 +15,7 @@ class AbstractSpakkyFastAPIError(AbstractSpakkyCoreError, ABC):
15
15
  if message is not None:
16
16
  self.message = message
17
17
 
18
- def to_response(self, show_traceback: bool) -> JSONResponse:
18
+ def to_response(self, show_traceback: bool = False) -> JSONResponse:
19
19
  return ORJSONResponse(
20
20
  content={
21
21
  "message": self.message,
@@ -1,3 +1,4 @@
1
+ from traceback import print_exc
1
2
  from typing import Awaitable, Callable, TypeAlias
2
3
 
3
4
  from fastapi import Request
@@ -26,6 +27,8 @@ class ErrorHandlingMiddleware(BaseHTTPMiddleware):
26
27
  try:
27
28
  return await call_next(request)
28
29
  except AbstractSpakkyFastAPIError as e:
29
- return e.to_response(self.__debug)
30
+ return e.to_response()
30
31
  except Exception:
32
+ if self.__debug:
33
+ print_exc()
31
34
  return InternalServerError().to_response(self.__debug)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spakky-fastapi
3
- Version: 2.1.0
3
+ Version: 2.3.0
4
4
  Summary: Highly abstracted Framework core to use DDD & DI/IoC & AOP & Etc...
5
5
  Author: Spakky
6
6
  Author-email: sejong418@icloud.com
@@ -1,8 +1,8 @@
1
1
  spakky_fastapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- spakky_fastapi/error.py,sha256=UIcoG80BlTbFOtZ6q-UL_pLSJMup9OKIBzlUaHLOTWw,1705
2
+ spakky_fastapi/error.py,sha256=JbiHOe10fkL2z9jDFoPigI_CHgXHs0-3yaCGoauEybI,1713
3
3
  spakky_fastapi/main.py,sha256=TRWTpo_oktbFq2eJ-AynpWsZH2MoFTBuEldMrlxHHrQ,399
4
4
  spakky_fastapi/middlewares/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- spakky_fastapi/middlewares/error_handling.py,sha256=KXMivDNY8ly87GcTyvCTuIsOSzMafFd6h5cAJtlKlBQ,985
5
+ spakky_fastapi/middlewares/error_handling.py,sha256=z9YrElCKKB6Z-RHlkpIcj1yqzvU4jSSuEGFcVbmLOEc,1062
6
6
  spakky_fastapi/middlewares/manage_context.py,sha256=K9jFih1uU3LQzwLbj8kpLgPPln_KKM0D02qv7tzea-E,901
7
7
  spakky_fastapi/post_processors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  spakky_fastapi/post_processors/add_builtin_middlewares.py,sha256=ePyVYV5CssbRIGxakS85RvsGmHr8LVMFkcu-_QttSCc,1185
@@ -20,7 +20,7 @@ spakky_fastapi/routes/route.py,sha256=LhUOq9wZJjHc8C0A59BrraipBsb_5gX_WDI6wkcUO9
20
20
  spakky_fastapi/routes/websocket.py,sha256=UA9qVduqAbGyToOUo4giPhdy9lKWJkHhrNF9LnKMRgU,703
21
21
  spakky_fastapi/stereotypes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  spakky_fastapi/stereotypes/api_controller.py,sha256=gnUVdQnK2miMMwBgQ88bbMajMAvmBwjwS3semtLBkBY,222
23
- spakky_fastapi-2.1.0.dist-info/METADATA,sha256=oFMdeG39N0CwHmPX6DZHd6GUlhOrJ0QNsQpWznNtVlE,1860
24
- spakky_fastapi-2.1.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
25
- spakky_fastapi-2.1.0.dist-info/entry_points.txt,sha256=m_VotPZLovg4sBMBm_XK5ateHrUizil9dQ11-2v-ZMw,57
26
- spakky_fastapi-2.1.0.dist-info/RECORD,,
23
+ spakky_fastapi-2.3.0.dist-info/METADATA,sha256=pzxyusokS4HJjSy6jOwSW094mHqJVYoXiitcXzEgilM,1860
24
+ spakky_fastapi-2.3.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
25
+ spakky_fastapi-2.3.0.dist-info/entry_points.txt,sha256=m_VotPZLovg4sBMBm_XK5ateHrUizil9dQ11-2v-ZMw,57
26
+ spakky_fastapi-2.3.0.dist-info/RECORD,,