From 70383d90852ccb4b1aaf3fec4965f69884b89e33 Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Sat, 8 Jun 2024 03:23:04 +0700 Subject: [PATCH] MISC: Change error message when spawning on an invalid server (#1370) --- src/NetscriptFunctions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index a9e63df53..36388e631 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -737,11 +737,11 @@ export const ns: InternalAPI = { const args = helpers.scriptArgs(ctx, _args); setTimeout(() => { const scriptServer = GetServer(ctx.workerScript.hostname); - if (scriptServer == null) { - throw helpers.errorMessage(ctx, "Could not find server. This is a bug. Report to dev"); + if (scriptServer === null) { + 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); helpers.log(ctx, () => `Will execute '${path}' in ${runOpts.spawnDelay} milliseconds`);