Skip to content

Commit 0496dee

Browse files
fix: handle missing status_code attribute in backoff strategy logging
Co-Authored-By: alexandre@airbyte.io <alexandre@airbyte.io>
1 parent 8ed04ef commit 0496dee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/wait_time_from_header_backoff_strategy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ def backoff_time(
6262
header_value = get_numeric_value_from_header(response_or_exception, header, regex)
6363
if header_value is not None:
6464
logger.info(
65-
"Rate limit header '%s' detected with value: %s (status code: %d)",
65+
"Rate limit header '%s' detected with value: %s (status code: %s)",
6666
header,
6767
header_value,
68-
response_or_exception.status_code,
68+
response_or_exception.status_code if hasattr(response_or_exception, "status_code") else "N/A",
6969
)
7070
if (
7171
self.max_waiting_time_in_seconds

0 commit comments

Comments
 (0)