From 1d8d86572acd0c1c850a622ff7eb5af5305b1bb0 Mon Sep 17 00:00:00 2001 From: Nikolay Bryskin Date: Tue, 22 Apr 2025 18:36:19 +0300 Subject: [PATCH] fix: pass error types to wait strategy in retry decorator - retryhttp/_retry.py: Pass `server_error_codes`, `network_errors`, and `timeouts` to `wait_context_aware`. - This enables the wait strategy to correctly identify the error type (server, network, timeout) and apply the appropriate wait duration. --- retryhttp/_retry.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retryhttp/_retry.py b/retryhttp/_retry.py index 421398f..7102038 100644 --- a/retryhttp/_retry.py +++ b/retryhttp/_retry.py @@ -154,6 +154,9 @@ def retry( wait_network_errors=wait_network_errors, wait_timeouts=wait_timeouts, wait_rate_limited=wait_rate_limited, + server_error_codes=server_error_codes, + network_errors=network_errors, + timeouts=timeouts, ) stop = kwargs.pop("stop", None) or stop_after_attempt(max_attempt_number)