Skip to main content
Class Base class for every exception the Crossmint SDK throws.
Every subclass carries a code (CrossmintErrorCode) so consumer code can switch on error categories instead of string-matching on message. The optional cause preserves the original error / payload that triggered this exception — useful for logging and programmatic handling.

Constructors

CrossmintException

Creates a generic CrossmintException. Prefer throwing a subclass scoped to the failure domain (auth / wallet / signer / …).

Properties

message

Human-readable message suitable for logs. Not localized — do not show this directly to end users.

code

A machine-readable error code for programmatic switch/case handling.

cause

The underlying cause — typically a lower-level exception or an API response payload. Inspect this for extra detail when diagnosing errors.

apiErrorCode

The code the Crossmint API put in its error envelope, verbatim (for example LAST_RECOVERY_SIGNER), or null when the failure did not come from an API response or the response carried none. Lets callers branch on the backend’s own code even when code has no member for it.

statusCode

The HTTP status of the response that reported this failure (for example 404), or null when no HTTP response did, such as a transport error, a timeout, or a 2xx body the SDK could not read. Lets callers tell a request the API rejected (4xx) from a server failure without parsing message.

Methods

toString