Better error message when invoking function that doesn't exist

pull/774/head
Zef Hemel 2024-02-28 10:54:03 +01:00
parent 7f0eb21030
commit 16d1d3265b
1 changed files with 5 additions and 1 deletions

View File

@ -76,7 +76,11 @@ export abstract class CommonSystem {
}
invokeSpaceFunction(name: string, args: any[]) {
return this.scriptEnv.functions[name](...args);
const fn = this.scriptEnv.functions[name];
if (!fn) {
throw new Error(`Function ${name} not found`);
}
return fn(...args);
}
async applyAttributeExtractors(