From 4e5d5fae42ac1b015bcae050c68126be69b00a8a Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 12 Aug 2026 01:36:25 +0000 Subject: [PATCH] fix(http): fail fast on HTTP 413 instead of retrying Co-Authored-By: bot_apk --- .../streams/http/error_handlers/default_error_mapping.py | 5 +++++ .../error_handlers/test_default_error_handler.py | 9 +++++++++ .../error_handlers/test_default_http_response_filter.py | 1 + 3 files changed, 15 insertions(+) diff --git a/airbyte_cdk/sources/streams/http/error_handlers/default_error_mapping.py b/airbyte_cdk/sources/streams/http/error_handlers/default_error_mapping.py index 45716768fd..c25e519e54 100644 --- a/airbyte_cdk/sources/streams/http/error_handlers/default_error_mapping.py +++ b/airbyte_cdk/sources/streams/http/error_handlers/default_error_mapping.py @@ -58,6 +58,11 @@ failure_type=FailureType.transient_error, error_message="HTTP Status Code: 408. Error: Request timeout.", ), + 413: ErrorResolution( + response_action=ResponseAction.FAIL, + failure_type=FailureType.system_error, + error_message="HTTP Status Code: 413. Error: The request or its response exceeds the size limit accepted by the API.", + ), 429: ErrorResolution( response_action=ResponseAction.RATE_LIMITED, failure_type=FailureType.transient_error, diff --git a/unit_tests/sources/declarative/requesters/error_handlers/test_default_error_handler.py b/unit_tests/sources/declarative/requesters/error_handlers/test_default_error_handler.py index 526e5760fc..d915522323 100644 --- a/unit_tests/sources/declarative/requesters/error_handlers/test_default_error_handler.py +++ b/unit_tests/sources/declarative/requesters/error_handlers/test_default_error_handler.py @@ -56,6 +56,15 @@ 408, DEFAULT_ERROR_MAPPING[408], ), + ( + "_with_http_response_status_413", + 413, + ErrorResolution( + response_action=ResponseAction.FAIL, + failure_type=FailureType.system_error, + error_message="HTTP Status Code: 413. Error: The request or its response exceeds the size limit accepted by the API.", + ), + ), ( "_with_unmapped_http_status_418", 418, diff --git a/unit_tests/sources/declarative/requesters/error_handlers/test_default_http_response_filter.py b/unit_tests/sources/declarative/requesters/error_handlers/test_default_http_response_filter.py index cddec68e43..07e79184e6 100644 --- a/unit_tests/sources/declarative/requesters/error_handlers/test_default_http_response_filter.py +++ b/unit_tests/sources/declarative/requesters/error_handlers/test_default_http_response_filter.py @@ -23,6 +23,7 @@ pytest.param(403, DEFAULT_ERROR_MAPPING[403], id="403 mapping"), pytest.param(404, DEFAULT_ERROR_MAPPING[404], id="404 mapping"), pytest.param(408, DEFAULT_ERROR_MAPPING[408], id="408 mapping"), + pytest.param(413, DEFAULT_ERROR_MAPPING[413], id="413 mapping"), ], ) def test_matches_mapped_http_status_code(http_code, expected_error_resolution):