SignalWireRestError
Custom exception class for REST API errors. Extends Python’s built-in Exception
class. Raised when an HTTP request to the SignalWire REST API returns a non-success
status code.
A request that never produces a response raises
SignalWireRestTransportError, a subclass of this class.
Catching SignalWireRestError handles both.
Properties
status_code
HTTP status code returned by the API (e.g., 404, 422, 500). None for a
transport failure that produced no response.
body
Response body from the API (JSON dict if parseable, otherwise raw string).
url
The full URL that was requested, including the query string.
method
The HTTP method used ("GET", "POST", "PUT", "PATCH", "DELETE").
headers
Response headers from the API. None for a transport failure.
request_id
The platform request ID, read from the x-request-id,
x-signalwire-request-id, request-id, or x-amzn-requestid response header.
Also appended to the exception message. Quote it when contacting support.