qbraid.runtime.RuntimeAPIError

exception RuntimeAPIError(message, status_code=None, error_code=None, trace=None, solution=None, more_info=None)[source]

Exception raised when a provider’s REST API returns an error response.

Carries the HTTP status code so callers can branch on the failure mode (e.g. distinguish “job doesn’t exist” from “credentials rejected”) instead of string-matching the exception message.

Where the provider returns a structured error body, error_code holds the provider’s own error identifier (finer-grained than the HTTP status), trace the request id to quote in a support ticket, solution the provider’s user-facing remediation text, and more_info a link to its error docs. All are None when the provider returned no structured error.

solution is a suggestion from the provider, not gospel: it may be stale, may contain markup, and may reference the provider’s own SDK rather than the caller’s. Present it to users deliberately, not blindly.

Note: this also subclasses ValueError because these provider paths previously raised a bare ValueError. Keeping that base means existing except ValueError code keeps working. It is transitional and can be dropped in a future major release.