diff options
Diffstat (limited to 'app/assets/javascripts/ci/runner/sentry_utils.js')
-rw-r--r-- | app/assets/javascripts/ci/runner/sentry_utils.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/app/assets/javascripts/ci/runner/sentry_utils.js b/app/assets/javascripts/ci/runner/sentry_utils.js index 29de1f9adae..25fecdcfa7d 100644 --- a/app/assets/javascripts/ci/runner/sentry_utils.js +++ b/app/assets/javascripts/ci/runner/sentry_utils.js @@ -6,15 +6,16 @@ const COMPONENT_TAG = 'vue_component'; * Captures an error in a Vue component and sends it * to Sentry * - * @param {Object} options - * @param {Error} options.error - Exception or error - * @param {String} options.component - Component name in CamelCase format + * @param {Object} options Exception details + * @param {Object} options.error An exception-like object + * @param {string} [options.component=] Component name in CamelCase format */ export const captureException = ({ error, component }) => { - Sentry.withScope((scope) => { - if (component) { - scope.setTag(COMPONENT_TAG, component); - } + if (component) { + Sentry.captureException(error, { + tags: { [COMPONENT_TAG]: component }, + }); + } else { Sentry.captureException(error); - }); + } }; |