Skip to content

Commit

Permalink
fix: prevent default rejection handling (#1791)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoumitaM authored Jul 22, 2024
1 parent b284617 commit 025d4f6
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class ErrorHandler implements IErrorHandler {
(globalThis as typeof window).addEventListener(
'unhandledrejection',
(event: PromiseRejectionEvent) => {
if (!(event.reason instanceof Error)) {
// Prevent the default handling by the browser
event.preventDefault();
}
this.onError(event, undefined, undefined, undefined, ErrorType.UNHANDLEDREJECTION);
},
);
Expand Down

0 comments on commit 025d4f6

Please sign in to comment.