Skip to content

Commit f75f94c

Browse files
StefanRijnhartMPoch-PlanetaTIC
authored andcommitted
[FIX] Redundant error handling
raise_for_status() raises the same exception, with the response's _content available from the exception's `response` attribute. Moreover, passing the headers as a positional argument when creating the exception makes the api key from the authorization header show up in the string representation of the exception in logs and messages.
1 parent e0038f5 commit f75f94c

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

connector_magento/components/backend_adapter.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ def call(self, resource_path, arguments, http_method=None, storeview=None):
7979
elif arguments is not None:
8080
kwargs['json'] = arguments
8181
res = function(url, **kwargs)
82-
if (res.status_code == 400 and res._content):
83-
raise requests.HTTPError(
84-
url, res.status_code, res._content, headers, __name__)
8582
res.raise_for_status()
8683
return res.json()
8784

0 commit comments

Comments
 (0)