Correctly log uncaught errors/unhandled promises (#3857)

This commit is contained in:
David Marby authored and GitHub committed 2021-07-28 14:57:52 -04:00
1 parent a12ccc3faf
commit cecd95f0d7
1 file changed
+2 -2
+2 -2
View File
@@ -68,11 +68,11 @@ window['styled-components'] = styledComponents;
// Catch uncaught errors and report them
if (window && !isDevelopment()) {
window.addEventListener('error', e => {
console.error('Uncaught Error', e);
console.error('Uncaught Error', e.error || e);
trackEvent('Error', 'Uncaught Error');
});
window.addEventListener('unhandledrejection', e => {
console.error('Unhandled Promise', e);
console.error('Unhandled Promise', e.reason);
trackEvent('Error', 'Uncaught Promise');
});
}