Skip to content

Class: QuantumSafeError ​

Defined in: errors.ts:61

Base class for every error this library throws.

Extends ​

  • Error

Extended by ​

Constructors ​

Constructor ​

new QuantumSafeError(message, code?, hint?): QuantumSafeError

Defined in: errors.ts:67

Parameters ​

message ​

string

code? ​

QsErrorCode = 'QS_ERROR'

hint? ​

string = ''

Returns ​

QuantumSafeError

Overrides ​

Error.constructor

Properties ​

code ​

readonly code: QsErrorCode

Defined in: errors.ts:63

Stable machine-readable identifier, e.g. QS_DECRYPTION_FAILED.


hint ​

readonly hint: string

Defined in: errors.ts:65

One-line, static suggestion for fixing the problem. Contains no sensitive data.

Methods ​

toJSON() ​

toJSON(): object

Defined in: errors.ts:85

JSON-safe description, useful for logs and for coding agents.

Returns ​

object

code ​

code: QsErrorCode

hint ​

hint: string

message ​

message: string

name ​

name: string


is() ​

static is(e): e is QuantumSafeError

Defined in: errors.ts:80

True for errors from any copy of this library. Prefer this to instanceof when an application might load both the ESM and the CommonJS build (each has its own class objects).

Parameters ​

e ​

unknown

Returns ​

e is QuantumSafeError

Apache-2.0.