qbraid_core.HttpStatusMixin

class qbraid_core.HttpStatusMixin

Adds status_code to exceptions that can carry an HTTP response.

Mixed into the errors that service clients raise from an except RequestsApiError handler, and only those. Errors with no API request behind them — configuration, installation, validation — do not get the attribute, so its absence is meaningful rather than a permanent None.

Clients wrap transport failures with raise ... from err and pass only a message, and __cause__ is set after __init__ returns, so the status cannot be captured at construction. It is read from the chain on access instead, which is why no raise site needs to thread it through.

__init__()

Methods

__init__()

Attributes

status_code

HTTP status of the underlying failed request.