bitburner-src/src/UncaughtPromiseHandler.ts
2022-09-27 15:35:39 -04:00

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",
);
});
}