@@ -11,6 +11,7 @@ import { setHttpStatus, SPAN_STATUS_ERROR, SPAN_STATUS_OK, startSpan } from '../
11
11
import type { IntegrationFn } from '../types-hoist/integration' ;
12
12
import { debug } from '../utils/debug-logger' ;
13
13
import { isPlainObject } from '../utils/is' ;
14
+ import { addExceptionMechanism } from '../utils/misc' ;
14
15
15
16
const AUTH_OPERATIONS_TO_INSTRUMENT = [
16
17
'reauthenticate' ,
@@ -410,22 +411,27 @@ function instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder: PostgRESTFilte
410
411
err . details = res . error . details ;
411
412
}
412
413
413
- const supabaseContext : Record < string , unknown > = { } ;
414
+ const supabaseContext : Record < string , any > = { } ;
414
415
if ( queryItems . length ) {
415
416
supabaseContext . query = queryItems ;
416
417
}
417
418
if ( Object . keys ( body ) . length ) {
418
419
supabaseContext . body = body ;
419
420
}
420
421
421
- captureException ( err , {
422
- mechanism : {
423
- handled : false ,
424
- type : 'auto.db.supabase.postgres' ,
425
- } ,
426
- contexts : {
427
- supabase : supabaseContext ,
428
- } ,
422
+ captureException ( err , scope => {
423
+ scope . addEventProcessor ( e => {
424
+ addExceptionMechanism ( e , {
425
+ handled : false ,
426
+ type : 'auto.db.supabase.postgres' ,
427
+ } ) ;
428
+
429
+ return e ;
430
+ } ) ;
431
+
432
+ scope . setContext ( 'supabase' , supabaseContext ) ;
433
+
434
+ return scope ;
429
435
} ) ;
430
436
}
431
437
0 commit comments