summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts
diff options
context:
space:
mode:
authorLeah <kevinlukej@gmail.com>2024-02-03 16:05:33 +0000
committerLeah <kevinlukej@gmail.com>2024-02-03 16:05:33 +0000
commit441523b6d4d5ecd14c813690d34978899a1ccd43 (patch)
treec7ccdab16d999c2e19f1e2533a9758a70860741f /packages/frontend/src/scripts
parentMerge branch 'chore/updateMarkdownAndTemplates' into 'develop' (diff)
parentadded lines and lines to errors (diff)
downloadsharkey-441523b6d4d5ecd14c813690d34978899a1ccd43.tar.gz
sharkey-441523b6d4d5ecd14c813690d34978899a1ccd43.tar.bz2
sharkey-441523b6d4d5ecd14c813690d34978899a1ccd43.zip
merge: Added lines and line numbers to syntax errors (!395)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/395 Approved-by: dakkar <dakkar@thenautilus.net>
Diffstat (limited to 'packages/frontend/src/scripts')
-rw-r--r--packages/frontend/src/scripts/install-plugin.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/frontend/src/scripts/install-plugin.ts b/packages/frontend/src/scripts/install-plugin.ts
index ee218df018..1d1a8a3f77 100644
--- a/packages/frontend/src/scripts/install-plugin.ts
+++ b/packages/frontend/src/scripts/install-plugin.ts
@@ -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);