Skip to content

Commit e70e611

Browse files
yf-yangDouweM
andauthored
Fix docs custom retry logic example (#3276)
Co-authored-by: Douwe Maan <[email protected]>
1 parent d78ebc9 commit e70e611

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/retries.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ client = create_network_resilient_client()
214214

215215
```python {title="custom_retry_logic.py"}
216216
import httpx
217-
from tenacity import stop_after_attempt, wait_exponential
217+
from tenacity import retry_if_exception, stop_after_attempt, wait_exponential
218218

219219
from pydantic_ai.retries import AsyncTenacityTransport, RetryConfig, wait_retry_after
220220

@@ -230,7 +230,7 @@ def create_custom_retry_client():
230230

231231
transport = AsyncTenacityTransport(
232232
config=RetryConfig(
233-
retry=custom_retry_condition,
233+
retry=retry_if_exception(custom_retry_condition),
234234
# Use wait_retry_after for smart waiting on rate limits,
235235
# with custom exponential backoff as fallback
236236
wait=wait_retry_after(

0 commit comments

Comments
 (0)