From 28bf01ab4aa52daa2edc56a7a84a23205f575589 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Wed, 26 Mar 2025 20:54:15 -0400 Subject: [PATCH] restore AiScript error handling --- packages/frontend/src/plugin.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/plugin.ts b/packages/frontend/src/plugin.ts index 581ab35341..b482d30471 100644 --- a/packages/frontend/src/plugin.ts +++ b/packages/frontend/src/plugin.ts @@ -64,7 +64,11 @@ export async function parsePluginMeta(code: string): Promise try { ast = parser.parse(code); } catch (err) { - throw new Error('Aiscript syntax error'); + if (err instanceof Error) { + throw new Error(`Aiscript syntax error\n${(err as Error).message}`); + } else { + throw new Error('Aiscript syntax error'); + } } const meta = Interpreter.collectMetadata(ast);