MCPcopy Index your code
hub / github.com/cockroachdb/errors / WrapWithGrpcCode

Function WrapWithGrpcCode

extgrpc/ext_grpc.go:64–69  ·  view source on GitHub ↗

WrapWithGrpcCode wraps an error with a gRPC status code.

(err error, code codes.Code)

Source from the content-addressed store, hash-verified

62
63// WrapWithGrpcCode wraps an error with a gRPC status code.
64func WrapWithGrpcCode(err error, code codes.Code) error {
65 if err == nil {
66 return nil
67 }
68 return &withGrpcCode{cause: err, code: code}
69}
70
71// GetGrpcCode retrieves the gRPC code from a stack of causes.
72func GetGrpcCode(err error) codes.Code {

Callers 5

ErrorFunction · 0.92
ErrorfFunction · 0.92
WrapErrFunction · 0.92
WrapErrfFunction · 0.92
TestGrpcFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestGrpcFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…