Fix error throwing for unknown errors

Fix error throwing for unknown errors.

This should prevent unknown script/unknown error message and allow players to see custom errors that they throw.
This commit is contained in:
Snarling 2021-11-13 09:52:17 -05:00
parent c21644397d
commit b0f7fdca44

@ -138,7 +138,8 @@ function startNetscript2Script(workerScript: WorkerScript): Promise<WorkerScript
workerScript.errorMessage = e;
throw workerScript;
}
throw e; // Don't know what to do with it, let's rethrow.
workerScript.errorMessage = makeRuntimeRejectMsg(workerScript, "Unknown error: " + JSON.stringify(e));
throw workerScript;
});
}