Register errors so that they can be safely transmitted over gRPC.
In both client and server:
someError := errors.New("some error")
grpcerrors.Register(1, someError)
In the server:
return nil, grperrors.ToProto(err)
In the client:
_, err := grpcCall()
if grpcerrors.FromProto(err) == someError {
// ...
}