Skip to content

Commit eca8c01

Browse files
committed
Remove rethrowing errors
1 parent ad61fcd commit eca8c01

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/core/src/integrations/supabase.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,11 @@ const _instrumentRpcConsumer = (target: unknown, thisArg: unknown, argumentsList
892892

893893
return processedResponse;
894894
} catch (err: unknown) {
895+
// Handle span processing errors without re-throwing.
896+
// The outer .catch() is for RPC promise rejections only.
897+
// Re-throwing here would cause duplicate spans and duplicate captureException calls
898+
// because the .then().catch() pattern catches errors from both promise rejections
899+
// and errors thrown within the .then() callback.
895900
DEBUG_BUILD && debug.log('Consumer span processing failed', { queueName, error: err });
896901

897902
captureException(err, scope => {
@@ -907,7 +912,10 @@ const _instrumentRpcConsumer = (target: unknown, thisArg: unknown, argumentsList
907912
});
908913

909914
span.setStatus({ code: SPAN_STATUS_ERROR });
910-
throw err;
915+
916+
// Return the original response since the RPC call itself succeeded.
917+
// Only span processing failed, which we've already captured.
918+
return res;
911919
}
912920
},
913921
);

0 commit comments

Comments
 (0)