diff --git a/panic-overlay.js b/panic-overlay.js index f3ed599..cdcb0f0 100644 --- a/panic-overlay.js +++ b/panic-overlay.js @@ -403,7 +403,13 @@ function toggle (yes) { function onUncaughtError (e) { if (config.handleErrors) panic (e) } -window.addEventListener ('error', e => onUncaughtError (e.error)) +window.addEventListener ('error', e => { + if (!e.error) { + onUncaughtError (e.message) + return + } + onUncaughtError (e.error) +}) window.addEventListener ('unhandledrejection', e => onUncaughtError (e.reason)) ;(function onReady (fn) {