1- import * as SentryNode from '@sentry/node ' ;
1+ import { captureException , getClient , getCurrentScope } from '@sentry/core ' ;
22// eslint-disable-next-line import/no-extraneous-dependencies
33import { H3Error } from 'h3' ;
44import type { CapturedErrorContext } from 'nitropack' ;
@@ -8,7 +8,7 @@ import { extractErrorContext, flushIfServerless } from '../utils';
88 * Hook that can be added in a Nitro plugin. It captures an error and sends it to Sentry.
99 */
1010export async function sentryCaptureErrorHook ( error : Error , errorContext : CapturedErrorContext ) : Promise < void > {
11- const sentryClient = SentryNode . getClient ( ) ;
11+ const sentryClient = getClient ( ) ;
1212 const sentryClientOptions = sentryClient ?. getOptions ( ) ;
1313
1414 if (
@@ -33,12 +33,12 @@ export async function sentryCaptureErrorHook(error: Error, errorContext: Capture
3333 } ;
3434
3535 if ( path ) {
36- SentryNode . getCurrentScope ( ) . setTransactionName ( `${ method } ${ path } ` ) ;
36+ getCurrentScope ( ) . setTransactionName ( `${ method } ${ path } ` ) ;
3737 }
3838
3939 const structuredContext = extractErrorContext ( errorContext ) ;
4040
41- SentryNode . captureException ( error , {
41+ captureException ( error , {
4242 captureContext : { contexts : { nuxt : structuredContext } } ,
4343 mechanism : { handled : false } ,
4444 } ) ;
0 commit comments