(err error)
| 868 | } |
| 869 | |
| 870 | func grpcStatusForError(err error) *statusv1.Status { |
| 871 | status := &statusv1.Status{ |
| 872 | Code: int32(CodeUnknown), |
| 873 | Message: err.Error(), |
| 874 | } |
| 875 | if connectErr, ok := asError(err); ok { |
| 876 | status.Code = int32(connectErr.Code()) //nolint:gosec // No information loss |
| 877 | status.Message = connectErr.Message() |
| 878 | status.Details = connectErr.detailsAsAny() |
| 879 | } |
| 880 | return status |
| 881 | } |
| 882 | |
| 883 | // grpcPercentEncode follows RFC 3986 Section 2.1 and the gRPC HTTP/2 spec. |
| 884 | // It's a variant of URL-encoding with fewer reserved characters. It's intended |
no test coverage detected