File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
packages/nextjs/src/edge/utils Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -77,20 +77,22 @@ export function withEdgeWrapping<H extends EdgeRouteHandler>(
7777 // store a seen flag on it.
7878 const objectifiedErr = objectify ( e ) ;
7979
80- currentScope ?. addEventProcessor ( event => {
81- addExceptionMechanism ( event , {
82- type : 'instrument' ,
83- handled : false ,
84- data : {
85- function : options . mechanismFunctionName ,
86- } ,
87- } ) ;
88- return event ;
89- } ) ;
90-
9180 span ?. setStatus ( 'internal_error' ) ;
9281
93- captureException ( objectifiedErr ) ;
82+ captureException ( objectifiedErr , scope => {
83+ scope . addEventProcessor ( event => {
84+ addExceptionMechanism ( event , {
85+ type : 'instrument' ,
86+ handled : false ,
87+ data : {
88+ function : options . mechanismFunctionName ,
89+ } ,
90+ } ) ;
91+ return event ;
92+ } ) ;
93+
94+ return scope ;
95+ } ) ;
9496
9597 throw objectifiedErr ;
9698 } finally {
You can’t perform that action at this time.
0 commit comments