# @ledgerhq/errors

> Ledger common errors

Latest version **7.0.0** (published 2026-08-04) · Apache-2.0 license · 589.1K weekly downloads

## Install

```sh
npm install @ledgerhq/errors
pnpm add @ledgerhq/errors
yarn add @ledgerhq/errors
bun add @ledgerhq/errors
```

## Health

**Score 85/100 (A)** — status: active.

Positive: moderate downloads; has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2026-08-04 |
| First published | 2019-01-18 |
| Weekly downloads | 589.1K |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 234.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 618 |
| Maintainers | phenry-ledger, sergii-shkolin, gbrahm-ledger, thomas.coudray, ldg-github-ci, vbouzon, ledger-releaser |
| Keywords | Ledger |

## Links

- npm: https://www.npmjs.com/package/@ledgerhq/errors
- Repository: https://github.com/LedgerHQ/ledger-live
- Homepage: https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/errors
- Issues: https://github.com/LedgerHQ/ledger-live/issues
- npm.io page: https://npm.io/package/@ledgerhq/errors

## Recent versions

- 7.0.0 (latest) — 2026-08-04
- 7.0.0-nightly.20260804030101 (nightly) — 2026-08-04
- 6.22.0-next.0 (next) — 2025-06-17
- 6.17.0-windows-certificate.0 (windows-certificate) — 2024-05-28
- 6.16.2-new-wc.0 (new-wc) — 2024-02-20
- 6.16.2-new-wc-test.0 (new-wc-test) — 2024-02-20
- 6.16.2-wc-test.0 (wc-test) — 2024-02-14
- 6.15.0-tag-word.0 (tag-word) — 2023-10-25
- 6.12.7-notarizer.0 (notarizer) — 2023-06-22
- 6.12.4-recover-beta.0 (recover-beta) — 2023-04-01
- 6.12.4-recover-simu.0 (recover-simu) — 2023-03-24
- 6.12.4-recover-staging.0 (recover-staging) — 2023-03-22
- 6.12.2-protect.0 (protect) — 2022-12-19
- 6.11.2-ts-llm.0 (ts-llm) — 2022-11-03
- 6.10.1-yolo.0 (yolo) — 2022-07-12
- … 390 more at https://npm.io/package/@ledgerhq/errors/versions

## README

<img src="https://user-images.githubusercontent.com/4631227/191834116-59cf590e-25cc-4956-ae5c-812ea464f324.png" height="100" />

## @ledgerhq/errors

> \[!WARNING]
> **Status: DEPRECATED** — Frozen; do not add new errors here. Define errors as plain `class extends Error` in your own package's `src/errors.ts`.

> ⚠️ **Deprecated and frozen.** Do not add new errors here and do not use
> `createCustomErrorClass` or the serialize/deserialize stack. Define errors as
> plain native classes in your own package's `src/errors.ts` and check them with
> `error.name === "X"`. See [DEPRECATED.md](./DEPRECATED.md).

Hodl all possible errors of Ledger (live, ledgerjs) so we can deal with them in a unified way (share between libraries, `instanceof` them,...)

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

*   [HwTransportErrorType](#hwtransporterrortype)
*   [HwTransportError](#hwtransporterror)
    *   [Parameters](#parameters)
*   [TransportError](#transporterror)
    *   [Parameters](#parameters-1)
*   [TransportStatusError](#transportstatuserror)
    *   [Parameters](#parameters-2)

### HwTransportErrorType

Type of a Transport error used to represent all equivalent errors coming from all possible implementation of Transport

### HwTransportError

**Extends Error**

Represents an error coming from the usage of any Transport implementation.

Needed to map a specific implementation error into an error that
can be managed by any code unaware of the specific Transport implementation
that was used.

#### Parameters

*   `type` **[HwTransportErrorType](#hwtransporterrortype)**&#x20;
*   `message` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;

### TransportError

**Extends Error**

TransportError is used for any generic transport errors.
e.g. Error thrown when data received by exchanges are incorrect or if exchanged failed to communicate with the device for various reason.

#### Parameters

*   `message` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;

### TransportStatusError

**Extends Error**

Error thrown when a device returned a non success status.
the error.statusCode is one of the `StatusCodes` exported by this library.

#### Parameters

*   `statusCode` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The error status code coming from a Transport implementation
*   `options` **{canBeMappedToChildError: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?}** containing:*   canBeMappedToChildError: enable the mapping of TransportStatusError to an error extending/inheriting from it
        . Ex: LockedDeviceError. Default to true. (optional, default `{}`)

    *   `options.canBeMappedToChildError`   (optional, default `true`)

---
_Source: https://npm.io/package/@ledgerhq/errors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
