restore AiScript error handling

This commit is contained in:
Hazelnoot 2025-03-26 20:54:15 -04:00
parent 0e28b8a1f5
commit 28bf01ab4a

View file

@ -64,7 +64,11 @@ export async function parsePluginMeta(code: string): Promise<AiScriptPluginMeta>
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);