Skip to content

Commit 36359bb

Browse files
committed
switch vue to use captureException from @sentry/core
1 parent 6727d24 commit 36359bb

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

packages/vue/src/errorhandler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { getCurrentHub } from '@sentry/browser';
2+
import { captureException } from '@sentry/core';
23

34
import { formatComponentName, generateComponentTrace } from './components';
45
import { Options, ViewModel, Vue } from './types';
@@ -31,7 +32,7 @@ export const attachErrorHandler = (app: Vue, options: Options): void => {
3132
setTimeout(() => {
3233
getCurrentHub().withScope(scope => {
3334
scope.setContext('vue', metadata);
34-
getCurrentHub().captureException(error);
35+
captureException(error);
3536
});
3637
});
3738

packages/vue/src/router.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { captureException, WINDOW } from '@sentry/browser';
1+
import { WINDOW } from '@sentry/browser';
2+
import { captureException } from '@sentry/core';
23
import { Transaction, TransactionContext, TransactionSource } from '@sentry/types';
34

45
import { getActiveTransaction } from './tracing';

packages/vue/test/router.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import * as SentryBrowser from '@sentry/browser';
1+
import * as SentryCore from '@sentry/core';
22
import { Transaction } from '@sentry/types';
33

44
import { vueRouterInstrumentation } from '../src';
55
import { Route } from '../src/router';
66
import * as vueTracing from '../src/tracing';
77

8-
const captureExceptionSpy = jest.spyOn(SentryBrowser, 'captureException');
8+
const captureExceptionSpy = jest.spyOn(SentryCore, 'captureException');
99

1010
const mockVueRouter = {
1111
onError: jest.fn<void, [(error: Error) => void]>(),

0 commit comments

Comments
 (0)