Skip to content

Function: fromWasmError() ​

fromWasmError(e): Error

Defined in: errors.ts:355

Maps the kind tag attached by the WASM layer to a typed error. Internal. An error that is already a QuantumSafeError is returned unchanged. An unknown or missing kind becomes a CryptoError with code QS_INTERNAL_ERROR; a WebAssembly.RuntimeError (a Rust panic) is reported with a fixed message instead of its own text. A verification_failed kind always yields a VerificationError with the fixed default message.

Parameters ​

e ​

unknown

The value thrown by the WASM module (or any other thrown value).

Returns ​

Error

The typed error to throw to the caller.

Apache-2.0.