Skip to content

Commit

Permalink
fix: update giveup handler to check exc.response is not None and try …
Browse files Browse the repository at this point in the history
…all the error string (#195)
  • Loading branch information
am6010 authored Jun 25, 2024
1 parent bdbde9c commit 6c44fd1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def giveup_handler(exc):
return False
if isinstance(exc, JSONDecodeError):
return False
if TOKEN_REFRESH_RETRIES_EXCEEDED_ERROR.lower() in exc.response.text.lower():
if exc.response is not None and TOKEN_REFRESH_RETRIES_EXCEEDED_ERROR.lower() in exc.response.text.lower():
return False
if TOKEN_REFRESH_RETRIES_EXCEEDED_ERROR.lower() in str(exc):
return False
if isinstance(exc, (HubspotInvalidAuth, HubspotAccessDenied)):
return True
Expand Down

0 comments on commit 6c44fd1

Please sign in to comment.