fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit ec47fda964 - Show all commits

View file

@ -719,7 +719,11 @@ export class GBVMService extends GBService {
const context = vm.createContext(sandbox);
const code = min.sandBoxMap[text];
vm.runInContext(code, context);
try {
vm.runInContext(code, context);
} catch (error) {
throw new Error(`INVALID BASIC CODE: ${error.message} ${error.stack}`);
}
// Tries to find the method related to this call.
@ -738,7 +742,7 @@ export class GBVMService extends GBService {
ret = await sandbox[mainMethod](step);
} catch (error) {
GBLog.error(`BASIC ERROR: ${error.message} ${error.stack}`);
throw new Error(`BASIC ERROR: ${error.message} ${error.stack}`);
}
return ret;
}