Skip to content

Commit 621e52f

Browse files
committed
ref(core): Improve event mechanism for supabase integration
1 parent 8f4d56f commit 621e52f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/core/src/integrations/supabase.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ function instrumentAuthOperation(operation: AuthOperationFn, isAdmin = false): A
235235

236236
captureException(res.error, {
237237
mechanism: {
238-
handled: false,
238+
// assuming handled: true because users are expected to handle returned errors
239+
handled: true,
240+
type: 'supabase.auth',
239241
},
240242
});
241243
} else {
@@ -251,7 +253,9 @@ function instrumentAuthOperation(operation: AuthOperationFn, isAdmin = false): A
251253

252254
captureException(err, {
253255
mechanism: {
256+
// assuming handled: false here because this is an unexpected error
254257
handled: false,
258+
type: 'supabase.auth',
255259
},
256260
});
257261

@@ -417,6 +421,11 @@ function instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder: PostgRESTFilte
417421
}
418422

419423
captureException(err, {
424+
mechanism: {
425+
// assuming handled: true here because users are expected to handle returned errors
426+
handled: true,
427+
type: 'supabase.db',
428+
},
420429
contexts: {
421430
supabase: supabaseContext,
422431
},
@@ -448,6 +457,7 @@ function instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder: PostgRESTFilte
448457
return res;
449458
},
450459
(err: Error) => {
460+
// TODO: shouldn't we capture this error?
451461
if (span) {
452462
setHttpStatus(span, 500);
453463
span.end();

0 commit comments

Comments
 (0)