FigraniumError. The class normalizes HTTP responses and transport failures into a single, inspectable error type so you can branch on status codes, error codes, or transport conditions without parsing raw responses.
FigraniumError
FigraniumError extends the standard Error class, so .message, .stack, and .cause are also available.
Basic handling
Fields
status
status
- The HTTP status returned by the Figranium server, if a response arrived.
0when the request never reached a status (network failure, DNS error, 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.response
response
The original
Response object, when the error came from an HTTP response. Available for advanced consumers who need the raw headers or body.Branching on status
Transport failures
When the request never gets a response (server unreachable, DNS failure, TLS error),status is 0 and code is NETWORK_ERROR. The .cause property carries the underlying error.
Cancellation
Cancelled requests throwFigraniumError { status: 0, code: "REQUEST_ABORTED" }. The .cause reflects the underlying AbortSignal.reason when set. See Request options for cancellation patterns.