From e35d6c46c91371fc00b0525625f908a90cbbc4c8 Mon Sep 17 00:00:00 2001 From: Theis Pieter Hollebeek Date: Sat, 11 Oct 2025 15:24:11 +0200 Subject: [PATCH] more descriptive errors --- src/index.js | 2 +- src/vermiparous.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index e31d854..0b609a1 100644 --- a/src/index.js +++ b/src/index.js @@ -62,7 +62,7 @@ importButton.onclick = async (ev) => { return; } if (files.length > 1) { - throw new Error("unreachable: something went wrong !"); + throw new Error("unreachable: something went wrong ! files.length > 1"); } const item = Vermiparous.de(await fetch(URL.createObjectURL(files[0])).then((x) => x.bytes())); }; diff --git a/src/vermiparous.js b/src/vermiparous.js index 4cf7e6f..d0e53fd 100644 --- a/src/vermiparous.js +++ b/src/vermiparous.js @@ -42,7 +42,7 @@ export class Vermiparous { while (idx < bytes.length) { buffer.push(bytes[idx]); if (buffer.length >= MAX_KW_LENGTH) { - throw new Error("unreachable: something went wrong !"); + throw new Error("unreachable: something went wrong ! unrecognized action"); } if (buffer.length < MIN_KW_LENGTH || !isKeyword(buffer)) { ++idx;