added lines and lines to errors

This commit is contained in:
KevinWh0 2024-02-02 21:32:08 +01:00
parent 2a8e93e4be
commit 93bd4dc8fe
3 changed files with 22 additions and 1 deletions

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);