Merge pull request #1274 from Mikunj/better-error

Improve unhandled promise error logging
pull/1275/head
Mikunj Varsani 5 years ago committed by GitHub
commit 8d6b2e7c85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -136,7 +136,7 @@ window.onerror = (message, script, line, col, error) => {
}; };
window.addEventListener('unhandledrejection', rejectionEvent => { window.addEventListener('unhandledrejection', rejectionEvent => {
window.log.error( const error = rejectionEvent.reason;
`Top-level unhandled promise rejection: ${rejectionEvent.reason}` const errorInfo = error && error.stack ? error.stack : JSON.stringify(error);
); window.log.error(`Top-level unhandled promise rejection: ${errorInfo}`);
}); });

Loading…
Cancel
Save