Skip to content

Commit 9fd99bf

Browse files
cursoragentclaude
andcommitted
ref(grpc): Eliminate duplicate span status logic in finishSpan
Refactored finishSpan to call setRPCStatus internally instead of duplicating the same three lines (grpcStatusCode, toSpanStatus, SetData). This avoids maintaining identical status-setting logic in two places and ensures consistency if the logic needs to change. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent c2bdf69 commit 9fd99bf

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

grpc/client.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ func createOrUpdateMetadata(ctx context.Context, span *sentry.Span) context.Cont
4848
}
4949

5050
func finishSpan(span *sentry.Span, err error) {
51-
code := grpcStatusCode(err)
52-
span.Status = toSpanStatus(code)
53-
span.SetData("rpc.grpc.status_code", int(code))
51+
setRPCStatus(span, err)
5452
span.Finish()
5553
}
5654

0 commit comments

Comments
 (0)