UNPKG

@hiero-ledger/cryptography

Version:

Cryptographic utilities and primitives for the Hiero SDK

24 lines (21 loc) 582 B
/** * Signals that a key could not be realized from the input. */ export default class BadKeyError extends Error { /** * @param {Error | string} messageOrCause */ constructor(messageOrCause) { super( messageOrCause instanceof Error ? messageOrCause.message : messageOrCause, ); this.name = "BadKeyError"; if (messageOrCause instanceof Error) { /** @type {Error=} */ this.cause = messageOrCause; this.stack = messageOrCause.stack; } } }