arpakitlib 1.8.241__py3-none-any.whl → 1.8.242__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.
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "arpakitlib_project_template_version": "5",
3
- "arpakitlib_project_template_subversion": "61"
3
+ "arpakitlib_project_template_subversion": "62"
4
4
  }
@@ -15,6 +15,7 @@ from project.api.api_error_codes import APIErrorCodes
15
15
  from project.api.api_exception import APIException
16
16
  from project.api.response import APIJSONResponse
17
17
  from project.api.schema.out.common.error import ErrorCommonSO
18
+ from project.business_service.exception import BaseBusinessServiceException
18
19
  from project.sqlalchemy_db_.sqlalchemy_db import get_cached_sqlalchemy_db
19
20
  from project.sqlalchemy_db_.sqlalchemy_model import StoryLogDBM
20
21
 
@@ -57,6 +58,12 @@ def create_api_exception_handler(
57
58
  error_common_so = exception.error_common_so
58
59
  error_common_so.error_data = combine_dicts(old_error_data, error_common_so.error_data)
59
60
 
61
+ elif isinstance(exception, BaseBusinessServiceException):
62
+ if exception.data_api_error_status_code is not None:
63
+ status_code = exception.data_api_error_status_code
64
+ if exception.data_api_error_common_so is not None:
65
+ error_common_so = exception.data_api_error_common_so
66
+
60
67
  elif (
61
68
  isinstance(exception, fastapi.exceptions.HTTPException)
62
69
  or isinstance(exception, starlette.exceptions.HTTPException)
@@ -1,17 +1,33 @@
1
1
  from typing import Any
2
2
 
3
+ from project.api.schema.out.common.error import ErrorCommonSO
4
+
3
5
 
4
6
  class BaseBusinessServiceException(Exception):
5
7
  def __init__(
6
8
  self,
7
9
  message: str,
8
10
  *,
9
- data: dict[str, Any] | None = None
11
+ data: dict[str, Any] | None = None,
12
+ data_api_error_status_code: int | None = None,
13
+ data_api_error_error_common_so: ErrorCommonSO | None = None,
10
14
  ):
11
15
  self.message = message
12
16
  if data is None:
13
- data = None
17
+ data = {}
14
18
  self.data = data
19
+ if data_api_error_status_code is not None:
20
+ self.data["data_api_error_status_code"] = data_api_error_status_code
21
+ if data_api_error_error_common_so is not None:
22
+ self.data["data_api_error_error_common_so"] = data_api_error_error_common_so
23
+
24
+ @property
25
+ def data_api_error_status_code(self) -> int | None:
26
+ return self.data.get("data_api_error_status_code")
27
+
28
+ @property
29
+ def data_api_error_common_so(self) -> ErrorCommonSO | None:
30
+ return self.data.get("data_api_error_common_so")
15
31
 
16
32
  def __str__(self):
17
33
  parts = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arpakitlib
3
- Version: 1.8.241
3
+ Version: 1.8.242
4
4
  Summary: arpakitlib
5
5
  License: Apache-2.0
6
6
  Keywords: arpakitlib,arpakit,arpakit-company,arpakitcompany,arpakit_company
@@ -8,7 +8,7 @@ arpakitlib/_arpakit_project_template_v_5/alembic/env.py,sha256=Qesmnj5A2kB-Doeuf
8
8
  arpakitlib/_arpakit_project_template_v_5/alembic/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
9
9
  arpakitlib/_arpakit_project_template_v_5/alembic/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  arpakitlib/_arpakit_project_template_v_5/alembic.ini,sha256=8fuyeEvGBiPGbxEFy8ISBV3xX_fgVmuhEGpB10_B5Uo,3733
11
- arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json,sha256=-iGWUrlyiQ84CvVv-oCpreRG7rz5mNlyPMaavY0PrwQ,98
11
+ arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json,sha256=0k10OV5jE0K3WC6Yhzve1EqVa-jxlUr18skkcmKZlmQ,98
12
12
  arpakitlib/_arpakit_project_template_v_5/command/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  arpakitlib/_arpakit_project_template_v_5/command/alembic_history.sh,sha256=OMnDNtHIksGh9iavWnzbtxcudZW4vjdcISsBXvzZSPw,22
14
14
  arpakitlib/_arpakit_project_template_v_5/command/alembic_revision_autogenerate.sh,sha256=yW2i-SBOtBx15Ya0poVQqKkJM5t2JZp06r9AEW-DmGE,46
@@ -93,7 +93,7 @@ arpakitlib/_arpakit_project_template_v_5/project/api/blank/common.py,sha256=ug1F
93
93
  arpakitlib/_arpakit_project_template_v_5/project/api/create_api_app.py,sha256=-xJLrNuiUC8K-L2Q_1YbQzi_2bquW3HgVx7Ye2haHNk,3076
94
94
  arpakitlib/_arpakit_project_template_v_5/project/api/create_first_data.py,sha256=BgqmD-7gXQ_zoz3ATqVacQzkg9lbvKnCSvQxm0M0Vxw,1824
95
95
  arpakitlib/_arpakit_project_template_v_5/project/api/event.py,sha256=P8gV2Bq6LeLH0JDN9Z3O401PMbyNr2n-tme2gPvT-m4,996
96
- arpakitlib/_arpakit_project_template_v_5/project/api/exception_handler.py,sha256=nZr8sY5kPLPcmXcxEhXR77FGKWddRltrOoyKGhUkhAE,11560
96
+ arpakitlib/_arpakit_project_template_v_5/project/api/exception_handler.py,sha256=noZ45RA8gTYef2tGJB9D3iy2qIejHfrIUsAl6tlAuqE,11967
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
99
  arpakitlib/_arpakit_project_template_v_5/project/api/middleware/limit_content_length.py,sha256=cEtGcJSh3e2EyuQCFqKzRcrl3qS6oIvpSv5UEbYsvR4,1622
@@ -176,7 +176,7 @@ arpakitlib/_arpakit_project_template_v_5/project/api/schema/util/create_obj_sche
176
176
  arpakitlib/_arpakit_project_template_v_5/project/api/start_api.py,sha256=9VOBnqXsbh0zh96EilNO2gSaUlol04aJO7EbvT1iTko,752
177
177
  arpakitlib/_arpakit_project_template_v_5/project/api/util.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
178
178
  arpakitlib/_arpakit_project_template_v_5/project/business_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
179
- arpakitlib/_arpakit_project_template_v_5/project/business_service/exception.py,sha256=HPs7trDBdXEb0B3LCzDIMJd1uSHPIWs7TI43ogWrONU,635
179
+ arpakitlib/_arpakit_project_template_v_5/project/business_service/exception.py,sha256=ssK-14ZGec_lwQOiLttxJ-tNo58c7FvNJMwdLHUcIcc,1371
180
180
  arpakitlib/_arpakit_project_template_v_5/project/business_service/hello_world.py,sha256=K0UcmwXuhUxHslOpwQ7h_igIFY4G63ekdhI2RwTWQbE,260
181
181
  arpakitlib/_arpakit_project_template_v_5/project/business_service/remove_operations.py,sha256=E2F8xonPeZovKKOHv-XDmsQUHvks8A6R89PVhF_pAQI,1780
182
182
  arpakitlib/_arpakit_project_template_v_5/project/celery_/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -424,8 +424,8 @@ arpakitlib/clone_pydantic_model_fields.py,sha256=xxLwtvJzDf8EWMvBE4psWIj8c-cyeCx
424
424
  arpakitlib/pydantic_schema_from_sqlalchemy_model.py,sha256=_5Y79kQ4lLIOL6_afIFVwxY1EXzTMpi-veRR-WkPFOs,2879
425
425
  arpakitlib/raise_own_exception_if_exception.py,sha256=A6TuNSBk1pHaQ_qxnUmE2LgsNGA1IGqX26b1_HEA4Nc,5978
426
426
  arpakitlib/really_validate_email.py,sha256=HBfhyiDB3INI6Iq6hR2WOMKA5wVWWRl0Qun-x__OZ9o,1201
427
- arpakitlib-1.8.241.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
428
- arpakitlib-1.8.241.dist-info/METADATA,sha256=9zdoYCPTVYXqGyVzyYxF0Pgde5y0JldKABXsc0XSFj4,3741
429
- arpakitlib-1.8.241.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
430
- arpakitlib-1.8.241.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
431
- arpakitlib-1.8.241.dist-info/RECORD,,
427
+ arpakitlib-1.8.242.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
428
+ arpakitlib-1.8.242.dist-info/METADATA,sha256=tvoK_rgfrA55dBvBhzjJ0CcWBnMxkyOgGTyj4tC--U8,3741
429
+ arpakitlib-1.8.242.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
430
+ arpakitlib-1.8.242.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
431
+ arpakitlib-1.8.242.dist-info/RECORD,,