From 8901b608a8febf030f08bbba4058038ed73c1a1e Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 15 Aug 2026 22:47:59 -0700 Subject: [PATCH] Log more helpful info on wasm error. --- src/assembly/index.ts | 2 +- src/lib/nano25519.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/assembly/index.ts b/src/assembly/index.ts index be6705e..5d2a4a1 100644 --- a/src/assembly/index.ts +++ b/src/assembly/index.ts @@ -195,7 +195,7 @@ const verify_k = new StaticArray(PUBLICKEY_BYTES) * @param {u64} k - 32-byte public key */ export function verify (mlen: i32): void { - if (mlen < 0 || mlen > 32768) throw new Error() + if (mlen < 0 || mlen > 32768) throw new Error('invalid message length') const s = verify_s const m = MESSAGE_BUFFER const k = verify_k diff --git a/src/lib/nano25519.ts b/src/lib/nano25519.ts index 2f402b2..115d90d 100644 --- a/src/lib/nano25519.ts +++ b/src/lib/nano25519.ts @@ -37,8 +37,7 @@ export const nano25519_init = (bytes: number[]): { derive: typeof derive, sign: file >>>= 0 row >>>= 0 col >>>= 0 - const message = 'nano25519/async wasm abort' - console.error(message, getString(msg), getString(file), { msg, file, row, col }) + const message = `Nano25519WasmError: ${getString(msg)}, ${getString(file)}, row ${row}, col ${col}` throw new Error(message) }, "performance.now" () { -- 2.52.0