mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
Improve unexpected error message (#133)
* Add ws details if available * Add likely cause of error * Attempt to display error
This commit is contained in:
parent
b6efe46d4c
commit
124e64379a
@ -751,8 +751,10 @@ export function handleUnknownError(e: unknown, ws: WorkerScript | ScriptDeath |
|
||||
e = ws ? makeBasicErrorMsg(ws, msg) : `RUNTIME ERROR:\n\n${msg}`;
|
||||
}
|
||||
if (typeof e !== "string") {
|
||||
console.error("Unexpected error type:", e);
|
||||
e = "Unexpected type of error thrown. See console output.";
|
||||
console.error("Unexpected error:", e);
|
||||
const msg = `Unexpected type of error thrown. This error was likely thrown manually within a script.
|
||||
Error has been logged to the console.\n\nType of error: ${typeof e}\nValue of error: ${e}`;
|
||||
e = ws ? makeBasicErrorMsg(ws, msg, "UNKNOWN") : msg;
|
||||
}
|
||||
dialogBoxCreate(initialText + e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user