bitburner-src/src/UncaughtPromiseHandler.ts

8 lines
285 B
TypeScript
Raw Normal View History

2022-08-28 11:33:38 +02:00
import { errorDialog } from "./ui/React/DialogBox";
2021-12-20 19:57:07 +01:00
export function setupUncaughtPromiseHandler(): void {
2022-08-28 11:33:38 +02:00
window.addEventListener("unhandledrejection", (e) =>
errorDialog(e.reason, "UNCAUGHT PROMISE ERROR\nYou forgot to await a promise\nmaybe hack / grow / weaken ?\n"),
);
2021-12-20 19:57:07 +01:00
}