@@ -70,14 +70,15 @@ function extractData(response: Response): Promise<unknown> {
70
70
return responseClone . text ( ) ;
71
71
}
72
72
73
- function captureRemixServerException ( err : Error , name : string ) : void {
73
+ function captureRemixServerException ( err : Error , name : string , request : Request ) : void {
74
74
// Skip capturing if the thrown error is not a 5xx response
75
75
// https://remix.run/docs/en/v1/api/conventions#throwing-responses-in-loaders
76
76
if ( isResponse ( err ) && err . status < 500 ) {
77
77
return ;
78
78
}
79
79
80
80
captureException ( isResponse ( err ) ? extractData ( err ) : err , scope => {
81
+ scope . setSDKProcessingMetadata ( { request } ) ;
81
82
scope . addEventProcessor ( event => {
82
83
addExceptionMechanism ( event , {
83
84
type : 'instrument' ,
@@ -127,7 +128,7 @@ function makeWrappedDocumentRequestFunction(
127
128
128
129
span ?. finish ( ) ;
129
130
} catch ( err ) {
130
- captureRemixServerException ( err , 'documentRequest' ) ;
131
+ captureRemixServerException ( err , 'documentRequest' , request ) ;
131
132
throw err ;
132
133
}
133
134
@@ -164,7 +165,7 @@ function makeWrappedDataFunction(origFn: DataFunction, id: string, name: 'action
164
165
currentScope . setSpan ( activeTransaction ) ;
165
166
span ?. finish ( ) ;
166
167
} catch ( err ) {
167
- captureRemixServerException ( err , name ) ;
168
+ captureRemixServerException ( err , name , args . request ) ;
168
169
throw err ;
169
170
}
170
171
0 commit comments