File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
packages/sveltekit/src/client Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -179,14 +179,13 @@ function instrumentSvelteKitFetch(originalFetch: SvelteKitFetch): SvelteKitFetch
179
179
name : `${ requestData . method } ${ requestData . url } ` , // this will become the description of the span
180
180
op : 'http.client' ,
181
181
data : requestData ,
182
- parentSpanId : activeSpan && activeSpan . spanId ,
183
182
} ,
184
- async span => {
185
- const fetchResult : Response = await wrappingTarget . apply ( thisArg , [ input , patchedInit ] ) ;
183
+ span => {
184
+ const promise : Promise < Response > = wrappingTarget . apply ( thisArg , [ input , patchedInit ] ) ;
186
185
if ( span ) {
187
- span . setHttpStatus ( fetchResult . status ) ;
186
+ promise . then ( res => span . setHttpStatus ( res . status ) ) . catch ( _ => span . setStatus ( 'internal_error' ) ) ;
188
187
}
189
- return fetchResult ;
188
+ return promise ;
190
189
} ,
191
190
) ;
192
191
} else {
You can’t perform that action at this time.
0 commit comments