Description
Raised when a request fails due to a client-side network issue — DNS failure, connection refused, timeout — rather than an API error response. Wraps the underlying httpx exception for context.
Proposed Steps
- Define
NetworkError(ShadeError) in errors.py.
- Add
original_error: Exception attribute.
- Catch
httpx.ConnectError, httpx.TimeoutException, httpx.ReadError in the HTTP client and re-raise as NetworkError.
Acceptance Criteria
- A connection timeout raises
NetworkError with original_error set to the httpx exception.
str(error) includes a human-readable description of the network failure.
- Does not suppress
KeyboardInterrupt or SystemExit.
Description
Raised when a request fails due to a client-side network issue — DNS failure, connection refused, timeout — rather than an API error response. Wraps the underlying
httpxexception for context.Proposed Steps
NetworkError(ShadeError)inerrors.py.original_error: Exceptionattribute.httpx.ConnectError,httpx.TimeoutException,httpx.ReadErrorin the HTTP client and re-raise asNetworkError.Acceptance Criteria
NetworkErrorwithoriginal_errorset to thehttpxexception.str(error)includes a human-readable description of the network failure.KeyboardInterruptorSystemExit.