(err error)
| 112 | } |
| 113 | |
| 114 | func grpcError(err error) error { |
| 115 | // if is already a grpc err then just return. something with more context has already created a |
| 116 | // standard grpc error and we will honor that |
| 117 | if _, ok := status.FromError(err); ok { |
| 118 | return err |
| 119 | } |
| 120 | |
| 121 | // if this is context cancelled, we return a grpc cancelled error |
| 122 | if errors.Is(err, context.Canceled) { |
| 123 | return status.Error(codes.Canceled, err.Error()) |
| 124 | } |
| 125 | |
| 126 | // rest all fall into internal server error |
| 127 | return status.Error(codes.Internal, err.Error()) |
| 128 | } |
no test coverage detected