MISC: Change error message when spawning on an invalid server (#1370)

This commit is contained in:
catloversg 2024-06-08 03:23:04 +07:00 committed by GitHub
parent 16b9ad21ea
commit 70383d9085
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -737,11 +737,11 @@ export const ns: InternalAPI<NSFull> = {
const args = helpers.scriptArgs(ctx, _args); const args = helpers.scriptArgs(ctx, _args);
setTimeout(() => { setTimeout(() => {
const scriptServer = GetServer(ctx.workerScript.hostname); const scriptServer = GetServer(ctx.workerScript.hostname);
if (scriptServer == null) { if (scriptServer === null) {
throw helpers.errorMessage(ctx, "Could not find server. This is a bug. Report to dev"); throw helpers.errorMessage(ctx, `Cannot find server ${ctx.workerScript.hostname}`);
} }
return runScriptFromScript("spawn", scriptServer, path, args, ctx.workerScript, runOpts); runScriptFromScript("spawn", scriptServer, path, args, ctx.workerScript, runOpts);
}, runOpts.spawnDelay); }, runOpts.spawnDelay);
helpers.log(ctx, () => `Will execute '${path}' in ${runOpts.spawnDelay} milliseconds`); helpers.log(ctx, () => `Will execute '${path}' in ${runOpts.spawnDelay} milliseconds`);