Skip to content

Commit

Permalink
Handle missing raw and retries on Response (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihkurtoglu authored Jun 5, 2024
1 parent 7fc823d commit a2082db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scaleapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def _api_request(
# Some endpoints only return 'OK' message without JSON
return json
elif res.status_code == 409 and "task" in endpoint and body.get("unique_id"):
retry_history = None
if "retries" in res.raw and "history" in res.raw.retries:
try:
retry_history = res.raw.retries.history

except AttributeError:
retry_history = []
# Example RequestHistory tuple
# RequestHistory(method='POST',
# url='/v1/task/imageannotation',
Expand Down

0 comments on commit a2082db

Please sign in to comment.