mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-23 15:49:42 -04:00
Correctly log uncaught errors/unhandled promises (#3857)
This commit is contained in:
@@ -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');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user