shopware-api-client 1.0.113__py3-none-any.whl → 1.0.114__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.
Potentially problematic release.
This version of shopware-api-client might be problematic. Click here for more details.
- shopware_api_client/base.py +1 -1
- shopware_api_client/exceptions.py +6 -1
- {shopware_api_client-1.0.113.dist-info → shopware_api_client-1.0.114.dist-info}/METADATA +1 -1
- {shopware_api_client-1.0.113.dist-info → shopware_api_client-1.0.114.dist-info}/RECORD +6 -6
- {shopware_api_client-1.0.113.dist-info → shopware_api_client-1.0.114.dist-info}/WHEEL +0 -0
- {shopware_api_client-1.0.113.dist-info → shopware_api_client-1.0.114.dist-info}/licenses/LICENSE +0 -0
shopware_api_client/base.py
CHANGED
|
@@ -277,7 +277,7 @@ class ClientBase:
|
|
|
277
277
|
if not isinstance(errors, (list, tuple)):
|
|
278
278
|
raise ValueError("`errors` attribute in json not a list/tuple!")
|
|
279
279
|
|
|
280
|
-
error: SWAPIError | SWAPIErrorList = SWAPIError.from_errors(errors) # type: ignore
|
|
280
|
+
error: SWAPIError | SWAPIErrorList = SWAPIError.from_errors(errors, response) # type: ignore
|
|
281
281
|
except ValueError:
|
|
282
282
|
error: SWAPIError | SWAPIErrorList = SWAPIError.from_response(response) # type: ignore
|
|
283
283
|
|
|
@@ -47,6 +47,8 @@ class SWAPIError(SWAPIException):
|
|
|
47
47
|
self.source = kwargs.get("source", {})
|
|
48
48
|
self.meta = kwargs.get("meta", {})
|
|
49
49
|
self.headers = kwargs.get("headers", {})
|
|
50
|
+
self.request = kwargs.get("request", None)
|
|
51
|
+
self.response = kwargs.get("response", None)
|
|
50
52
|
|
|
51
53
|
def __str__(self) -> str:
|
|
52
54
|
return f"Status: {self.status} {self.title} - {self.detail} - {self.source}"
|
|
@@ -87,10 +89,11 @@ class SWAPIError(SWAPIException):
|
|
|
87
89
|
return SWAPIError
|
|
88
90
|
|
|
89
91
|
@classmethod
|
|
90
|
-
def from_errors(cls, errors: list[dict[str, Any]]) -> "SWAPIErrorList":
|
|
92
|
+
def from_errors(cls, errors: list[dict[str, Any]], response: Response) -> "SWAPIErrorList":
|
|
91
93
|
errlist = []
|
|
92
94
|
|
|
93
95
|
for error in errors:
|
|
96
|
+
error.update({"response": response, "request": response.request})
|
|
94
97
|
exception_class = cls.get_exception_class(int(error["status"]))
|
|
95
98
|
errlist.append(exception_class(**error))
|
|
96
99
|
|
|
@@ -111,6 +114,8 @@ class SWAPIError(SWAPIException):
|
|
|
111
114
|
title=response.reason_phrase,
|
|
112
115
|
detail=response.text,
|
|
113
116
|
headers=response.headers,
|
|
117
|
+
request=response._request,
|
|
118
|
+
response=response,
|
|
114
119
|
)
|
|
115
120
|
|
|
116
121
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
shopware_api_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
shopware_api_client/base.py,sha256=
|
|
2
|
+
shopware_api_client/base.py,sha256=IidRcNtiGIFgGE6i1gQdngQHV2rYix1DSisqvSiR2C8,30409
|
|
3
3
|
shopware_api_client/cache.py,sha256=JtojK7yDfAM937rDoqJj_FpNFf3zsfueTSyUX_Gsk4w,4997
|
|
4
4
|
shopware_api_client/client.py,sha256=vkTZ8WLIu0Q3_73gXvidkTSpMJlWsJUjFyhDY2f2ISM,7583
|
|
5
5
|
shopware_api_client/config.py,sha256=6IzpkuoYsh0d5c0BR453n1ijQwxB74HDYx1L6dmlJwQ,1623
|
|
@@ -106,10 +106,10 @@ shopware_api_client/endpoints/store/__init__.py,sha256=LE_GL4jYVGrRdp6M1cPURI-UJ
|
|
|
106
106
|
shopware_api_client/endpoints/store/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
107
107
|
shopware_api_client/endpoints/store/core/address.py,sha256=Tm7ri-i0zhyt4LVEHaQy3xEvjapCCPRsYAp5lOCDOew,2774
|
|
108
108
|
shopware_api_client/endpoints/store/core/cart.py,sha256=34eNwuv7H9WZUtJGf4TkTGHiGynDT6xeAt0gIl7V4KI,2584
|
|
109
|
-
shopware_api_client/exceptions.py,sha256=
|
|
109
|
+
shopware_api_client/exceptions.py,sha256=sxQ1O_XSzmuEnuJkztnZ-zu-NCcOQ3kMWn_8M4j5YxA,4989
|
|
110
110
|
shopware_api_client/logging.py,sha256=4QSTK1vcdBew4shvLG-fm-xDOlddhOZeyb5T9Og0fSA,251
|
|
111
111
|
shopware_api_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
112
|
-
shopware_api_client-1.0.
|
|
113
|
-
shopware_api_client-1.0.
|
|
114
|
-
shopware_api_client-1.0.
|
|
115
|
-
shopware_api_client-1.0.
|
|
112
|
+
shopware_api_client-1.0.114.dist-info/METADATA,sha256=uibYK4OvISd5-2AlzY_Iljif_Ke0iFMh6e9ycuA6_Sc,24450
|
|
113
|
+
shopware_api_client-1.0.114.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
114
|
+
shopware_api_client-1.0.114.dist-info/licenses/LICENSE,sha256=qTihFhbGE2ZJJ7Byc9hnEYBY33yDK2Jw87SpAm0IKUs,1107
|
|
115
|
+
shopware_api_client-1.0.114.dist-info/RECORD,,
|
|
File without changes
|
{shopware_api_client-1.0.113.dist-info → shopware_api_client-1.0.114.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|