@@ -70,14 +70,16 @@ 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 } ) ;
82
+
81
83
scope . addEventProcessor ( event => {
82
84
addExceptionMechanism ( event , {
83
85
type : 'instrument' ,
@@ -127,7 +129,7 @@ function makeWrappedDocumentRequestFunction(
127
129
128
130
span ?. finish ( ) ;
129
131
} catch ( err ) {
130
- captureRemixServerException ( err , 'documentRequest' ) ;
132
+ captureRemixServerException ( err , 'documentRequest' , request ) ;
131
133
throw err ;
132
134
}
133
135
@@ -164,7 +166,7 @@ function makeWrappedDataFunction(origFn: DataFunction, id: string, name: 'action
164
166
currentScope . setSpan ( activeTransaction ) ;
165
167
span ?. finish ( ) ;
166
168
} catch ( err ) {
167
- captureRemixServerException ( err , name ) ;
169
+ captureRemixServerException ( err , name , args . request ) ;
168
170
throw err ;
169
171
}
170
172
0 commit comments