From 70042d8b7d63fbf565a0a663dae13d24b9d00223 Mon Sep 17 00:00:00 2001 From: Enix Date: Thu, 10 Oct 2019 14:28:07 +0800 Subject: [PATCH] fix: send extra error data --- src/analytics.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/analytics.ts b/src/analytics.ts index 40803c5..0581bf9 100644 --- a/src/analytics.ts +++ b/src/analytics.ts @@ -41,12 +41,12 @@ function reportError( return } - Sentry.captureException(error) - if (extra) { - Sentry.withScope(scope => { + Sentry.withScope(scope => { + if (extra) { Object.keys(extra).forEach(key => { scope.setExtra(key, extra[key]) }) - }) - } + } + Sentry.captureException(error) + }) }