File tree 1 file changed +14
-12
lines changed
packages/nextjs/src/edge/utils
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>(
77
77
// store a seen flag on it.
78
78
const objectifiedErr = objectify ( e ) ;
79
79
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
-
91
80
span ?. setStatus ( 'internal_error' ) ;
92
81
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
+ } ) ;
94
96
95
97
throw objectifiedErr ;
96
98
} finally {
You can’t perform that action at this time.
0 commit comments