Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/multisafepay/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def _create_request(
"Content-Type": "application/json",
}

response = None
try:
response = self.transport.request(
method=method,
Expand All @@ -354,7 +355,8 @@ def _create_request(
response.raise_for_status()
except Exception as e:
if (
hasattr(response, "status_code")
response is not None
and hasattr(response, "status_code")
and 500 <= response.status_code < 600
):
raise ApiException(f"Request failed: {e}") from e
Expand Down
Loading