Errorf returns a HTTP gRPC error that is correctly forwarded over gRPC, and can eventually be converted back to a HTTP response with HTTPResponseFromError.
(code int, tmpl string, args ...interface{})
| 120 | // gRPC, and can eventually be converted back to a HTTP response with |
| 121 | // HTTPResponseFromError. |
| 122 | func Errorf(code int, tmpl string, args ...interface{}) error { |
| 123 | return Error(code, fmt.Sprintf(tmpl, args...)) |
| 124 | } |
| 125 | |
| 126 | // ErrorFromHTTPResponse converts an HTTP response into a grpc error, and uses HTTP response body as an error message. |
| 127 | // Note that if HTTP response body contains non-utf8 string, then returned error cannot be marshalled by protobuf. |