Skip to content

Commit 5685474

Browse files
committed
fix type error
1 parent 92949d3 commit 5685474

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

packages/core/src/integrations/supabase.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { setHttpStatus, SPAN_STATUS_ERROR, SPAN_STATUS_OK, startSpan } from '../
1111
import type { IntegrationFn } from '../types-hoist/integration';
1212
import { debug } from '../utils/debug-logger';
1313
import { isPlainObject } from '../utils/is';
14+
import { addExceptionMechanism } from '../utils/misc';
1415

1516
const AUTH_OPERATIONS_TO_INSTRUMENT = [
1617
'reauthenticate',
@@ -410,22 +411,27 @@ function instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder: PostgRESTFilte
410411
err.details = res.error.details;
411412
}
412413

413-
const supabaseContext: Record<string, unknown> = {};
414+
const supabaseContext: Record<string, any> = {};
414415
if (queryItems.length) {
415416
supabaseContext.query = queryItems;
416417
}
417418
if (Object.keys(body).length) {
418419
supabaseContext.body = body;
419420
}
420421

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;
429435
});
430436
}
431437

0 commit comments

Comments
 (0)