REST Client

SignalWireRestTransportError

View as MarkdownOpen in Claude

Raised when a REST request fails before the server responds: connection refused, DNS failure, connection reset, TLS error, or a RequestOptions timeout. Subclass of SignalWireRestError, so one except SignalWireRestError clause handles both HTTP errors and transport failures.

from signalwire.rest import SignalWireRestTransportError

Properties

Inherits every property of SignalWireRestError with these values:

status_code
None

Always None; no response was produced.

body
str

The underlying transport error message.

url
str

The full URL that was requested, including the query string.

method
str

The HTTP method used.

headers
None

Always None.

request_id
None

Always None.

Example

from signalwire.rest import RestClient, SignalWireRestError, SignalWireRestTransportError
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
try:
client.phone_numbers.list()
except SignalWireRestTransportError as e:
print(f"Could not reach SignalWire: {e.body}")
except SignalWireRestError as e:
print(f"HTTP {e.status_code}: {e.body}")