> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CrossmintException

> Flutter Class

**Class**

Base class for every exception the Crossmint SDK throws.

```dart theme={null}
class CrossmintException implements Exception
```

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

```dart theme={null}
const CrossmintException(
  this.message, {
  this.code = CrossmintErrorCode.unknown,
  this.cause,
})
```

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

## Properties

### message

```dart theme={null}
final String message
```

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

### code

```dart theme={null}
final CrossmintErrorCode code
```

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

### cause

```dart theme={null}
final Object? cause
```

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

## Methods

### toString

```dart theme={null}
String toString()
```
