(
ctx context.Context,
method string,
req interface{},
reply interface{},
cc *grpc.ClientConn,
invoker grpc.UnaryInvoker,
opts ...grpc.CallOption,
)
| 10 | ) |
| 11 | |
| 12 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…