diff --git a/pyproject.toml b/pyproject.toml index 60d0a48..c2c738d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tap-salesforce-connect" -version = "0.1.2" +version = "0.1.3" description = "`tap-salesforce-connect` is a Singer tap for SalesforceConnect, built with the Meltano Singer SDK." readme = "README.md" authors = ["Josh Lloyd"] diff --git a/tap_salesforce_connect/client.py b/tap_salesforce_connect/client.py index 25dd130..346f3eb 100644 --- a/tap_salesforce_connect/client.py +++ b/tap_salesforce_connect/client.py @@ -114,9 +114,13 @@ def get_wait_time_based_on_response(self, exception): Salesforce Connect API has a rate limit scoped to an hour """ - if exception.response.status_code == 503: - return 60 * 60 - return exception.response.headers.get("Retry-After", 0) + if exception.response: + if exception.response.status_code == 503: + return 60 * 60 + else: + return exception.response.headers.get("Retry-After", 0) + else: + return 0 def backoff_wait_generator(self) -> Generator[float, None, None]: """Return a generator of wait times between retries."""