The single error class thrown by every helper in this package. Consumers discriminate via err instanceof CryptographyError && err.code === '<code>'.
err instanceof CryptographyError && err.code === '<code>'
Collapsing this to one class with a code field (rather than one subclass per failure mode) keeps the surface and tests small as new modes are added.
Construct a CryptographyError.
One of the CryptographyErrorCode values.
CryptographyErrorCode
Optional
Human-readable error message.
Optional ErrorOptions for chaining a cause.
cause
Readonly
The discriminator identifying which failure mode raised this error.
The single error class thrown by every helper in this package. Consumers discriminate via
err instanceof CryptographyError && err.code === '<code>'.Collapsing this to one class with a code field (rather than one subclass per failure mode) keeps the surface and tests small as new modes are added.