Remove withScope Sentry calls
Description
Our usages of withScope
from the Sentry Browser SDK can be replaced with a simpler call.
Instead of:
Sentry.withScope((scope) => {
scope.setTag('vue_component', 'PipelineEditorAiAssistantDrawer');
Sentry.captureException(error);
});
We can pass the context directly in a parameter to captureException
.
Sentry.captureException(error, tags: { 'vue_component', 'PipelineEditorAiAssistantDrawer' } );
Why refactor?
I'd like to remove calls of withScope
to reduce the surface area of the Sentry API we use, this will enable me to add some extra logging whenever we call Sentry.captureException
to make debugging of Sentry events easier, directly in the browser console