Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: SocketDev/socket-sdk-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 836936c
Choose a base ref
...
head repository: SocketDev/socket-sdk-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 273ee88
Choose a head ref
  • 1 commit
  • 6 files changed
  • 1 contributor

Commits on Jun 10, 2026

  1. Add transient-error classification to APIFailure (#93)

    * Add transient-error classification to APIFailure
    
    API.do_request now records the HTTP status code on every exception it
    raises (status_code attribute), and APIFailure gains
    is_transient_error(): True for gateway/connection-level failures
    (HTTP 408/502/503/504, dropped or reset connections, client-side
    timeouts) where retrying the same request may succeed, False for
    deterministic errors (400/401/403/404/429, wrapped unexpected errors).
    
    Classification is based on the recorded status code rather than
    exception class identity or message text, so it stays correct if a
    status code gains a dedicated subclass later.
    
    Motivated by SocketDev/socket-python-cli#232: the CLI retries transient
    full-scan upload failures and previously had to parse the status code
    out of catch-all APIFailure message text.
    
    * Hardcode 502 in APIBadGateway instead of accepting a status_code
    
    The class definitionally represents a 502, so there is no reason for
    construction sites to pass (or be able to override) the status.
    mtorp authored Jun 10, 2026
    Configuration menu
    Copy the full SHA
    273ee88 View commit details
    Browse the repository at this point in the history
Loading