From dd8c2a08dca9afaaba4245ff560401518a533846 Mon Sep 17 00:00:00 2001 From: rina Date: Tue, 27 Aug 2024 10:24:34 +1000 Subject: [PATCH] patch CS_ERR_OK message --- web/aslp.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/aslp.js b/web/aslp.js index a6eea9d..0d0e625 100644 --- a/web/aslp.js +++ b/web/aslp.js @@ -207,7 +207,10 @@ const synchroniseInputs = async (writeback, el) => { try { mnemonic = !err ? await stoneworker.bytes2asm(Comlink.transfer(bytes, [bytes.buffer])) : ''; } catch (exn) { - err = err || exn.toString(); + let s = exn.toString(); + if (s.includes('CS_ERR_OK')) + s = 'no recognised instruction'; + err = err || s; // console.error('error in bytes2asm:', exn); } asmInput.value = mnemonic;