FigraniumError. It covers HTTP error responses, network failures, timeouts, and request aborts. You can branch on error.status for HTTP semantics, on error.code for machine-readable categories, and on error.errorDescription for a human-readable message.
FigraniumError shape
FigraniumError conforms to LocalizedError, so error.errorDescription returns message and integrates with SwiftUI and NSError bridging.
Basic handling
Client.swift
Fields
status
status
The HTTP status returned by the Figranium server, if a response arrived.
0 when the request never reached a status, such as a network failure, DNS error, or cancelled request.code
code
Server-provided machine-readable error code, taken from the response body’s
error field. Also used for SDK-generated conditions:details
details
Free-form value from the response body’s
details or detail field. Typically an object describing which validation failed, which record was missing, or which field was invalid.requestID
requestID
Value of the
x-request-id response header, when the server or a proxy sets one. Include this in bug reports to make server-side logs easier to correlate.message
message
Human-readable description of what went wrong. For server errors, this is taken from the response body’s
message or error field. For SDK-generated errors, it describes the condition (for example, “Figranium request was cancelled”).Branching on status
Client.swift
Transport failures
When the request never gets a response (server unreachable, DNS failure, TLS error),status is 0 and code is NETWORK_ERROR.
Client.swift
Timeouts and cancellation
When a request exceeds the configured timeout, or when the callingTask is cancelled, the SDK raises FigraniumError with code: "REQUEST_ABORTED".
Client.swift
Task of a stream also aborts the underlying network request and raises FigraniumError(code: "REQUEST_ABORTED").