arpakitlib 1.8.229__py3-none-any.whl → 1.8.231__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.
- arpakitlib/_arpakit_project_template_v_5/project/api/middleware/limit_content_length.py +0 -1
- arpakitlib/raise_own_exception_if_exception.py +26 -12
- {arpakitlib-1.8.229.dist-info → arpakitlib-1.8.231.dist-info}/METADATA +1 -1
- {arpakitlib-1.8.229.dist-info → arpakitlib-1.8.231.dist-info}/RECORD +7 -7
- {arpakitlib-1.8.229.dist-info → arpakitlib-1.8.231.dist-info}/LICENSE +0 -0
- {arpakitlib-1.8.229.dist-info → arpakitlib-1.8.231.dist-info}/WHEEL +0 -0
- {arpakitlib-1.8.229.dist-info → arpakitlib-1.8.231.dist-info}/entry_points.txt +0 -0
@@ -16,6 +16,7 @@ def raise_own_exception_if_exception(
|
|
16
16
|
except_catching_exceptions: type[BaseException] | Tuple[type[BaseException], ...] | None = None,
|
17
17
|
own_exception: type[Exception],
|
18
18
|
kwargs_in_own_exception: dict[str, Any] | None = None,
|
19
|
+
forward_kwargs_in_own_exception: dict[str, Any] | None = None,
|
19
20
|
) -> (
|
20
21
|
Callable[[Callable[PARAMS_SPEC, RESULT_SPEC] | Callable[PARAMS_SPEC, Awaitable[RESULT_SPEC]]],
|
21
22
|
Callable[PARAMS_SPEC, RESULT_SPEC] | Callable[PARAMS_SPEC, Awaitable[RESULT_SPEC]]]
|
@@ -44,10 +45,11 @@ def raise_own_exception_if_exception(
|
|
44
45
|
else:
|
45
46
|
except_catching_exceptions = ()
|
46
47
|
|
47
|
-
kwargs_in_own_exception
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
if kwargs_in_own_exception is not None:
|
49
|
+
kwargs_in_own_exception = dict(kwargs_in_own_exception or {})
|
50
|
+
kwargs_in_own_exception["catching_exceptions"] = catching_exceptions
|
51
|
+
kwargs_in_own_exception["except_catching_exceptions"] = except_catching_exceptions
|
52
|
+
kwargs_in_own_exception["own_exception"] = own_exception
|
51
53
|
|
52
54
|
# Если явно передали пустой набор для ловли — возвращаем функцию как есть
|
53
55
|
if not catching_exceptions:
|
@@ -65,11 +67,17 @@ def raise_own_exception_if_exception(
|
|
65
67
|
except catching_exceptions as caught_exception: # ловим ТОЛЬКО нужные типы
|
66
68
|
if except_catching_exceptions and isinstance(caught_exception, except_catching_exceptions):
|
67
69
|
raise # пропускаем как есть
|
68
|
-
|
69
|
-
|
70
|
-
|
70
|
+
if kwargs_in_own_exception is not None:
|
71
|
+
copied_kwargs_in_own_exception = kwargs_in_own_exception.copy()
|
72
|
+
copied_kwargs_in_own_exception["caught_exception"] = caught_exception
|
73
|
+
copied_kwargs_in_own_exception["caught_exception_str"] = str(caught_exception)
|
71
74
|
try:
|
72
|
-
|
75
|
+
_kwargs = {}
|
76
|
+
if kwargs_in_own_exception is not None:
|
77
|
+
_kwargs = {"kwargs_": copied_kwargs_in_own_exception}
|
78
|
+
if forward_kwargs_in_own_exception is not None:
|
79
|
+
_kwargs.update(forward_kwargs_in_own_exception)
|
80
|
+
raise own_exception(**_kwargs) from caught_exception
|
73
81
|
except TypeError:
|
74
82
|
raise own_exception() from caught_exception
|
75
83
|
|
@@ -82,11 +90,17 @@ def raise_own_exception_if_exception(
|
|
82
90
|
except catching_exceptions as caught_exception:
|
83
91
|
if except_catching_exceptions and isinstance(caught_exception, except_catching_exceptions):
|
84
92
|
raise
|
85
|
-
|
86
|
-
|
87
|
-
|
93
|
+
if kwargs_in_own_exception is not None:
|
94
|
+
copied_kwargs_in_own_exception = kwargs_in_own_exception.copy()
|
95
|
+
copied_kwargs_in_own_exception["caught_exception"] = caught_exception
|
96
|
+
copied_kwargs_in_own_exception["caught_exception_str"] = str(caught_exception)
|
88
97
|
try:
|
89
|
-
|
98
|
+
_kwargs = {}
|
99
|
+
if kwargs_in_own_exception is not None:
|
100
|
+
_kwargs = {"kwargs_": copied_kwargs_in_own_exception}
|
101
|
+
if forward_kwargs_in_own_exception is not None:
|
102
|
+
_kwargs.update(forward_kwargs_in_own_exception)
|
103
|
+
raise own_exception(**_kwargs) from caught_exception
|
90
104
|
except TypeError:
|
91
105
|
raise own_exception() from caught_exception
|
92
106
|
|
@@ -96,7 +96,7 @@ arpakitlib/_arpakit_project_template_v_5/project/api/exception.py,sha256=BSCYbdH
|
|
96
96
|
arpakitlib/_arpakit_project_template_v_5/project/api/exception_handler.py,sha256=Se4Bj1Sdp6KXW7-G5xm0obJAFu3MfPA5NTm6yEEjgqU,11556
|
97
97
|
arpakitlib/_arpakit_project_template_v_5/project/api/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
98
98
|
arpakitlib/_arpakit_project_template_v_5/project/api/middleware/add_api_middlewares.py,sha256=TrWn0yPDCn0yTlHqLf19ypGtRumNjDxm0sM60yVsqXE,468
|
99
|
-
arpakitlib/_arpakit_project_template_v_5/project/api/middleware/limit_content_length.py,sha256=
|
99
|
+
arpakitlib/_arpakit_project_template_v_5/project/api/middleware/limit_content_length.py,sha256=cEtGcJSh3e2EyuQCFqKzRcrl3qS6oIvpSv5UEbYsvR4,1622
|
100
100
|
arpakitlib/_arpakit_project_template_v_5/project/api/openapi_ui.py,sha256=7yg9ZNu6BjTAregnfbRFpwvqa-gTIY6o6NCz5pmsbeo,976
|
101
101
|
arpakitlib/_arpakit_project_template_v_5/project/api/response.py,sha256=xZMymP2BuQaRNVWLeIp3UgUUo-MFN8MJnsn9Al4vOb8,1028
|
102
102
|
arpakitlib/_arpakit_project_template_v_5/project/api/router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -421,9 +421,9 @@ arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,40
|
|
421
421
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
|
422
422
|
arpakitlib/clone_pydantic_model_fields.py,sha256=xxLwtvJzDf8EWMvBE4psWIj8c-cyeCxLRX76oCY_4zk,1214
|
423
423
|
arpakitlib/pydantic_schema_from_sqlalchemy_model.py,sha256=_5Y79kQ4lLIOL6_afIFVwxY1EXzTMpi-veRR-WkPFOs,2879
|
424
|
-
arpakitlib/raise_own_exception_if_exception.py,sha256=
|
425
|
-
arpakitlib-1.8.
|
426
|
-
arpakitlib-1.8.
|
427
|
-
arpakitlib-1.8.
|
428
|
-
arpakitlib-1.8.
|
429
|
-
arpakitlib-1.8.
|
424
|
+
arpakitlib/raise_own_exception_if_exception.py,sha256=WCgrT0rwNMEAE__44TQaY4UXzRBKt-aJbMoOvTMGJVc,5541
|
425
|
+
arpakitlib-1.8.231.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
426
|
+
arpakitlib-1.8.231.dist-info/METADATA,sha256=75vxEXlio2WxvoHjIJMlomtsNuet-YtQHxftOmbTh4w,3741
|
427
|
+
arpakitlib-1.8.231.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
428
|
+
arpakitlib-1.8.231.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
429
|
+
arpakitlib-1.8.231.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|