Skip to content

Add retry for timeouts, connection errors, and server errors#159

Merged
beaufour merged 2 commits intomasterfrom
retry-transient-errors
Feb 7, 2026
Merged

Add retry for timeouts, connection errors, and server errors#159
beaufour merged 2 commits intomasterfrom
retry-transient-errors

Conversation

@beaufour
Copy link
Collaborator

@beaufour beaufour commented Feb 7, 2026

Summary

  • Extract retry logic from method_call.py into a shared retry.py module that handles HTTP 429 (rate limit), 5xx server errors, timeouts, and connection errors with exponential backoff
  • Add FlickrTimeoutError exception for timeout and connection failures
  • Apply retry behavior to both API calls and photo uploads
  • Add 11 tests covering all retry scenarios

Test plan

  • All 282 existing tests pass
  • 11 new retry tests pass (timeout, connection error, server error, upload retry)
  • flake8 lint passes
  • Manual testing against live Flickr API with network interruptions

🤖 Generated with Claude Code

beaufour and others added 2 commits February 7, 2026 08:27
Extract retry logic into a shared retry module that handles HTTP 429
(rate limit), 5xx (server errors), timeouts, and connection errors
with exponential backoff. Apply retry behavior to both API calls and
uploads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use sys.modules to get the upload module directly instead of
string-based patch, since `flickr_api.upload` resolves to the
upload function (not the module) on Python 3.10/3.12/3.13.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@beaufour beaufour merged commit 2f63944 into master Feb 7, 2026
5 checks passed
@beaufour beaufour deleted the retry-transient-errors branch February 7, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant