Log unhandled promise rejections in the rageshake (#12028)
This commit is contained in:
parent
46e301f8f8
commit
f0dd12dbc1
1 changed files with 5 additions and 0 deletions
|
@ -500,6 +500,11 @@ export function init(setUpPersistence = true): Promise<void> {
|
||||||
global.mx_rage_logger = new ConsoleLogger();
|
global.mx_rage_logger = new ConsoleLogger();
|
||||||
global.mx_rage_logger.monkeyPatch(window.console);
|
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) {
|
if (setUpPersistence) {
|
||||||
return tryInitStorage();
|
return tryInitStorage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue