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