File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
packages/nextjs/src/common Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -42,26 +42,31 @@ export function wrapServerComponentWithSentry<F extends (...args: any[]) => any>
4242 const isolationScope = getIsolationScope ( ) ;
4343 const span = getActiveSpan ( ) ;
4444 const { componentRoute, componentType } = context ;
45+ let shouldCapture = false ;
4546 isolationScope . setTransactionName ( `${ componentType } Server Component (${ componentRoute } )` ) ;
4647
4748 if ( span ) {
4849 if ( isNotFoundNavigationError ( error ) ) {
50+ shouldCapture = false ;
4951 // We don't want to report "not-found"s
5052 span . setStatus ( { code : SPAN_STATUS_ERROR , message : 'not_found' } ) ;
5153 } else if ( isRedirectNavigationError ( error ) ) {
54+ shouldCapture = false ;
5255 // We don't want to report redirects
5356 span . setStatus ( { code : SPAN_STATUS_OK } ) ;
5457 } else {
5558 span . setStatus ( { code : SPAN_STATUS_ERROR , message : 'internal_error' } ) ;
5659 }
5760 }
5861
59- captureException ( error , {
60- mechanism : {
61- handled : false ,
62- type : 'auto.function.nextjs.server_component' ,
63- } ,
64- } ) ;
62+ if ( shouldCapture ) {
63+ captureException ( error , {
64+ mechanism : {
65+ handled : false ,
66+ type : 'auto.function.nextjs.server_component' ,
67+ } ,
68+ } ) ;
69+ }
6570 } ,
6671 ( ) => {
6772 waitUntil ( flushSafelyWithTimeout ( ) ) ;
You can’t perform that action at this time.
0 commit comments