@ledgerhq/errors
TypeScript icon, indicating that this package has built-in type declarations

6.16.3 • Public • Published

@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)

Dependents (97)

Package Sidebar

Install

npm i @ledgerhq/errors

Weekly Downloads

128,442

Version

6.16.3

License

Apache-2.0

Unpacked Size

190 kB

Total Files

44

Last publish

Collaborators

  • thomas.coudray
  • ldg-github-ci
  • aboissiere
  • vbouzon
  • gbrahm-ledger
  • sergii-shkolin
  • phenry-ledger