Description
All SDK-specific errors must inherit from a common ShadeError so callers can catch all SDK errors with a single except ShadeError. It should carry a human-readable message, the HTTP status_code (if applicable), and the raw response_body for debugging.
Proposed Steps
- Create
src/shade/errors.py.
- Define
ShadeError(Exception) with __init__(self, message, status_code=None, response_body=None).
- Add
__str__ returning a formatted string including the status code when present.
- All other exceptions in this file must subclass
ShadeError.
Acceptance Criteria
except shade.ShadeError catches all SDK errors.
str(error) includes both the message and the HTTP status code when present.
error.response_body contains the raw API response as a string.
ShadeError can be raised standalone (e.g. for contract-level errors with no HTTP context).
Description
All SDK-specific errors must inherit from a common
ShadeErrorso callers can catch all SDK errors with a singleexcept ShadeError. It should carry a human-readablemessage, the HTTPstatus_code(if applicable), and the rawresponse_bodyfor debugging.Proposed Steps
src/shade/errors.py.ShadeError(Exception)with__init__(self, message, status_code=None, response_body=None).__str__returning a formatted string including the status code when present.ShadeError.Acceptance Criteria
except shade.ShadeErrorcatches all SDK errors.str(error)includes both the message and the HTTP status code when present.error.response_bodycontains the raw API response as a string.ShadeErrorcan be raised standalone (e.g. for contract-level errors with no HTTP context).