mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
Merge pull request #1274 from Mikunj/better-error
Improve unhandled promise error logging
This commit is contained in:
commit
8d6b2e7c85
|
@ -136,7 +136,7 @@ window.onerror = (message, script, line, col, error) => {
|
|||
};
|
||||
|
||||
window.addEventListener('unhandledrejection', rejectionEvent => {
|
||||
window.log.error(
|
||||
`Top-level unhandled promise rejection: ${rejectionEvent.reason}`
|
||||
);
|
||||
const error = rejectionEvent.reason;
|
||||
const errorInfo = error && error.stack ? error.stack : JSON.stringify(error);
|
||||
window.log.error(`Top-level unhandled promise rejection: ${errorInfo}`);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue