> For AI agents: the documentation index is at https://sdk.nimbusprivacy.xyz/llms.txt, and every page is available as Markdown at its URL with .md appended.

# Errors (/reference/errors)

The SDK throws two errors. [Errors](https://sdk.nimbusprivacy.xyz/helpers/errors) shows a `catch` block that tells them apart,
and [Results and errors](https://sdk.nimbusprivacy.xyz/api-design/results-and-errors) lists every reason.

## NimbusSdkError

The error the SDK throws when it cannot go on. Read its `reason` to decide what to tell the user.

The error every function of this package throws when it cannot go on.

Compare `reason`, not the message, and test for the error with [`isNimbusSdkError`](https://sdk.nimbusprivacy.xyz/reference/errors#isnimbussdkerror), which
holds across bundles where `instanceof` does not.

```ts
class NimbusSdkError extends Error {
  readonly name = "NimbusSdkError";
  readonly reason: NimbusSdkErrorReason;
  constructor(
    reason: NimbusSdkErrorReason,
    message: string,
    cause:
      | { readonly kind: "none" }
      | { readonly kind: "cause"; readonly cause: unknown },
  );
}
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/errors.ts`.

## isNimbusSdkError

Use it in a `catch` block to recognise a `NimbusSdkError` and read its `reason`.

```ts
function isNimbusSdkError(thrown: unknown): thrown is NimbusSdkError;
```

Returns whether a thrown value is a [`NimbusSdkError`](https://sdk.nimbusprivacy.xyz/reference/errors#nimbussdkerror), from this bundle or another copy of
the package.

**Parameters**

| Parameter | Type      | Description            |
| --------- | --------- | ---------------------- |
| `thrown`  | `unknown` | Whatever a call threw. |

**Returns**

`thrown is NimbusSdkError`

Whether it is named `NimbusSdkError` and carries one of its reasons.

**Example**

```ts
import { isNimbusSdkError, loadNimbusSdk } from "@umbra/nimbus-solana-web";

try {
  await loadNimbusSdk({ cluster: "mainnet" });
} catch (thrown) {
  if (isNimbusSdkError(thrown) && thrown.reason === "misconfigured") {
    console.error(thrown.message);
  }
}
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/errors.ts`.

## isNimbusSolanaFlowError

Use it in a `catch` block around a payment, to recognise the protocol's refusals.

```ts
function isNimbusSolanaFlowError(
  value: unknown,
): value is NimbusSolanaFlowError;
```

Returns whether a value is a [`NimbusSolanaFlowError`](https://sdk.nimbusprivacy.xyz/reference/types#nimbussolanaflowerror), by its name and reason.

**Parameters**

| Parameter | Type      | Description      |
| --------- | --------- | ---------------- |
| `value`   | `unknown` | Anything caught. |

**Returns**

`value is NimbusSolanaFlowError`

Whether it is one.

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/context/errors.ts`.


Last updated 21 October 2026
