Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Log unhandled promise rejections in the rageshake (#12028)
Browse files Browse the repository at this point in the history
  • Loading branch information
uhoreg authored Dec 15, 2023
1 parent 46e301f commit f0dd12d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rageshake/rageshake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,11 @@ export function init(setUpPersistence = true): Promise<void> {
global.mx_rage_logger = new ConsoleLogger();
global.mx_rage_logger.monkeyPatch(window.console);

// log unhandled rejections in the rageshake
window.addEventListener("unhandledrejection", (event) => {
global.mx_rage_logger.log("error", `Unhandled promise rejection: ${event.reason}`);
});

if (setUpPersistence) {
return tryInitStorage();
}
Expand Down

0 comments on commit f0dd12d

Please sign in to comment.