Fix scripts dying of weird causes.

This commit is contained in:
Olivier Gagnon
2021-12-13 22:26:22 -05:00
parent c1e3a170ab
commit de9fb24156
7 changed files with 43 additions and 36 deletions
+3
View File
@@ -14,6 +14,9 @@ export function netscriptDelay(time: number, workerScript: WorkerScript): Promis
}
export function makeRuntimeRejectMsg(workerScript: WorkerScript, msg: string): string {
if ((msg as any) instanceof WorkerScript) {
console.error("HERE");
}
const server = GetServer(workerScript.hostname);
if (server == null) {
throw new Error(`WorkerScript constructed with invalid server ip: ${workerScript.hostname}`);