diff --git a/methods/flex-micro.js b/methods/flex-micro.js index 6db11aa..f18f5b3 100644 --- a/methods/flex-micro.js +++ b/methods/flex-micro.js @@ -56,16 +56,20 @@ window.SENTRY_INIT_METHODS["flex-micro"] = { // this disables temp queueing hanlders, must be done before calling window.onerror() delete window.__SENTRY_MICRO__.error_queue; for (const [type, args] of errors) { - try { - delete error.__sentry_captured__; // see temp_queueing_patch() - } catch (x) {} - - if (type === 'error') { - window.onerror.apply(window, args); - } else if (type === 'unhandledrejection') { - window.onunhandledrejection.apply(window, args); - } else { // type === 'trycatch' - throw error; + let [micro, error] = match_and_extract(...args); + + if (micro) { + try { + delete error.__sentry_captured__; // see temp_queueing_patch() + } catch (x) {} + + if (type === 'error') { + window.onerror.apply(window, args); + } else if (type === 'unhandledrejection') { + window.onunhandledrejection.apply(window, args); + } else { // type === 'trycatch' + throw error; + } } } }