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

Function UnaryClientInterceptor

grpc/middleware/client.go:12–37  ·  view source on GitHub ↗
(
	ctx context.Context,
	method string,
	req interface{},
	reply interface{},
	cc *grpc.ClientConn,
	invoker grpc.UnaryInvoker,
	opts ...grpc.CallOption,
)

Source from the content-addressed store, hash-verified

10)
11
12func UnaryClientInterceptor(
13 ctx context.Context,
14 method string,
15 req interface{},
16 reply interface{},
17 cc *grpc.ClientConn,
18 invoker grpc.UnaryInvoker,
19 opts ...grpc.CallOption,
20) error {
21 err := invoker(ctx, method, req, reply, cc, opts...)
22
23 st := status.Convert(err)
24 var reconstituted error
25 for _, det := range st.Details() {
26 switch t := det.(type) {
27 case *errors.EncodedError:
28 reconstituted = errors.DecodeError(ctx, *t)
29 }
30 }
31
32 if reconstituted != nil {
33 err = reconstituted
34 }
35
36 return err
37}

Callers

nothing calls this directly

Calls 2

DecodeErrorFunction · 0.92
DetailsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…