Hi
This is a question on what is the best practice to handle errors in gRPC. To explain: I have a .proto file with a service API:
service Search {
rpc Search (Params) returns (Results)
}
where the "Results" could be defined as either:
message Results {
//int64 errorCode = 1; Should I uncomment this and the next line ??
//string errorDescription = 2;
repeated Result result = 3;
}
For the above .proto file, the generated _pb.go file will be like:
Search(ctx context.Context, in *Params, opts ...grpc.CallOption) (*Results, error)
Now there is an 'error' parameter in the API. What is the most recommended procedure to handle our application specific errors ? Should they be part of this "error" parameter or should we add a "error" member inside the "Results" message (uncommenting the lines) and handle outside this second parameter ?
Thanks
Sankar