diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py index 5b9c6584b06b..3c8fcc6dccb7 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py @@ -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