mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
restore AiScript error handling
This commit is contained in:
parent
0e28b8a1f5
commit
28bf01ab4a
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue