madenvel / KalinkaPlayer

Audio Player for Linux based SBC
GNU General Public License v3.0
0 stars 0 forks source link

Qobuz request retry on 5xx codes and connection / read tmeout errors #12

Closed madenvel closed 3 days ago

madenvel commented 4 days ago

Retry now only happens on ProtocolError, i.g. when remote end drops connection. It makes sense to retry in other scenarios, including 5xx error codes.

  1. Connection Errors (e.g., temporary network issues)

    httpx.ConnectError: Failed to connect to the server. httpx.ReadTimeout: Timeout while waiting for a response. httpx.WriteTimeout: Timeout while sending a request. httpx.ConnectTimeout: Timeout while establishing a connection.

  2. Server Errors (5xx status codes)

These indicate issues on the server side, which could be transient.

httpx.HTTPStatusError: Raised when an invalid HTTP response status is encountered. You may want to retry if the status code is in the 500–599 range (server errors like 500, 502, 503, 504).

  1. DNS Resolution Errors

    httpx.ProxyError: Failure to connect via a proxy server. httpx.NetworkError: General network-related error, could indicate a temporary issue with DNS resolution or routing.