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
@@ -139,7 +139,10 @@ function startNetscript2Script(workerScript: WorkerScript): Promise<WorkerScript
} else if (isScriptErrorMessage(e)) {
workerScript.errorMessage = e;
throw workerScript;
} else if (e instanceof WorkerScript) {
throw e;
}
workerScript.errorMessage = makeRuntimeRejectMsg(workerScript, e);
throw workerScript; // Don't know what to do with it, let's rethrow.
});