bitburner-src/src/UncaughtPromiseHandler.ts

12 lines
343 B
TypeScript
Raw Normal View History

2022-09-05 15:55:57 +02:00
import { handleUnknownError } from "./Netscript/NetscriptHelpers";
2021-12-20 19:57:07 +01:00
export function setupUncaughtPromiseHandler(): void {
2022-09-05 15:55:57 +02:00
window.addEventListener("unhandledrejection", (e) => {
handleUnknownError(
e.reason,
null,
"UNCAUGHT PROMISE ERROR\nYou forgot to await a promise\nmaybe hack / grow / weaken ?\n\n",
);
});
2021-12-20 19:57:07 +01:00
}