Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@ledgerhq/errors

LedgerHQ1.4mApache-2.06.22.0TypeScript support: included

Ledger common errors

Ledger

readme

@ledgerhq/errors

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

API

Table of Contents

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

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

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 The error status code coming from a Transport implementation
  • options {canBeMappedToChildError: 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)

changelog

@ledgerhq/errors

6.22.0

Minor Changes

6.22.0-next.0

Minor Changes

6.21.0

Minor Changes

6.21.0-next.0

Minor Changes

6.19.1

Patch Changes

6.19.1-next.0

Patch Changes

6.19.0

Minor Changes

Patch Changes

6.19.0-next.0

Minor Changes

Patch Changes

6.18.0

Minor Changes

Patch Changes

6.18.0-next.0

Minor Changes

Patch Changes

6.17.0

Minor Changes

Patch Changes

  • #6963 815ae3d Thanks @aussedatlo! - restore TransportRaceCondition instead of TransportPendingOperation that caused a breaking change

6.17.0-next.0

Minor Changes

Patch Changes

  • #6963 815ae3d Thanks @aussedatlo! - restore TransportRaceCondition instead of TransportPendingOperation that caused a breaking change

6.16.4

Patch Changes

6.16.4-next.0

Patch Changes

6.16.3

Patch Changes

6.16.3-next.0

Patch Changes

6.16.2

Patch Changes

6.16.2-next.0

Patch Changes

6.16.1

Patch Changes

  • #5171 52a3732 Thanks @alexandremgo! - Feat: new abort timeout on opening transport and APDU exchange

    On @ledgerhq/hw-transport

    • exchange adding an optional abortTimeoutMs arg to its definition
    • send taking an optional abortTimeoutMs and passing it to exchange
    • Some documentation and tracing

    On @ledgerhq/react-native-hw-transport-ble

    • open: enabling optional timeout when opening a transport instance
    • exchange: enabling optional timeout on APDU exchange, calling cancelPendingOperations on timeout
    • cancelPendingOperations: using a currentTransactionIds array of transactions id for each write, we can try to abort completely pending writes
    • More documentation + tracing + simple unit tests
  • #5432 4d1aade Thanks @alexandremgo! - chore: refactoring TransportStatusError

    Refactor into a real class in order to improve TS inference

6.16.1-next.0

Patch Changes

  • #5171 52a3732 Thanks @alexandremgo! - Feat: new abort timeout on opening transport and APDU exchange

    On @ledgerhq/hw-transport

    • exchange adding an optional abortTimeoutMs arg to its definition
    • send taking an optional abortTimeoutMs and passing it to exchange
    • Some documentation and tracing

    On @ledgerhq/react-native-hw-transport-ble

    • open: enabling optional timeout when opening a transport instance
    • exchange: enabling optional timeout on APDU exchange, calling cancelPendingOperations on timeout
    • cancelPendingOperations: using a currentTransactionIds array of transactions id for each write, we can try to abort completely pending writes
    • More documentation + tracing + simple unit tests
  • #5432 4d1aade Thanks @alexandremgo! - chore: refactoring TransportStatusError

    Refactor into a real class in order to improve TS inference

6.16.0

Minor Changes

Patch Changes

6.16.0-next.0

Minor Changes

Patch Changes

6.15.0

Minor Changes

6.15.0-next.0

Minor Changes

6.14.0

Minor Changes

  • #4154 3455944496 Thanks @kallen-ledger! - Added NotEnoughGasSwap to errors, will return amountFromWarning from useSwapTransaction and display and interpolate NotEnoughGasSwap in LLD

Patch Changes

6.14.0-next.0

Minor Changes

  • #4154 3455944496 Thanks @kallen-ledger! - Added NotEnoughGasSwap to errors, will return amountFromWarning from useSwapTransaction and display and interpolate NotEnoughGasSwap in LLD

Patch Changes

6.13.1

Patch Changes

6.13.1-next.0

Patch Changes

6.13.0

Minor Changes

6.13.0-next.0

Minor Changes

6.12.7

Patch Changes

6.12.7-next.0

Patch Changes

6.12.6

Patch Changes

6.12.6-next.0

Patch Changes

6.12.5

Patch Changes

6.12.5-next.0

Patch Changes

6.12.4

Patch Changes

6.12.4-next.0

Patch Changes

6.12.3

Patch Changes

6.12.3-next.0

Patch Changes

6.12.2

Patch Changes

6.12.2-next.0

Patch Changes

6.12.1

Patch Changes

6.12.1-next.0

Patch Changes

6.12.0

Minor Changes

Patch Changes

6.12.0-next.0

Minor Changes

Patch Changes

6.11.1

Patch Changes

6.11.1-next.0

Patch Changes

6.11.0

Minor Changes

6.11.0-next.0

Minor Changes

6.10.2

Patch Changes

  • #1179 ae5e33e15e Thanks @gre! - Improve TypeScript of @ledgerhq/errors and fixes 2 bugs in swap and stellar on their error handling

6.10.2-next.0

Patch Changes

  • #1179 ae5e33e15 Thanks @gre! - Improve TypeScript of @ledgerhq/errors and fixes 2 bugs in swap and stellar on their error handling

6.10.1

Patch Changes

6.10.1-next.0

Patch Changes