mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 21:53:50 +01:00
12 lines
343 B
TypeScript
12 lines
343 B
TypeScript
import { handleUnknownError } from "./Netscript/NetscriptHelpers";
|
|
|
|
export function setupUncaughtPromiseHandler(): void {
|
|
window.addEventListener("unhandledrejection", (e) => {
|
|
handleUnknownError(
|
|
e.reason,
|
|
null,
|
|
"UNCAUGHT PROMISE ERROR\nYou forgot to await a promise\nmaybe hack / grow / weaken ?\n\n",
|
|
);
|
|
});
|
|
}
|