Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1540)

Unified Diff: server/prpc/decoding.go

Issue 1605363002: common/prpc, tools/cmd/cproto: prpc client (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: rebased and addressed comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « server/prpc/auth.go ('k') | server/prpc/decoding_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/prpc/decoding.go
diff --git a/server/prpc/decoding.go b/server/prpc/decoding.go
index 874c48111b51c9267d89e6f4e071dadad013fb61..8379e223b31a2f5a8ef25fbbf3b630141896ea19 100644
--- a/server/prpc/decoding.go
+++ b/server/prpc/decoding.go
@@ -64,9 +64,9 @@ func requestFormat(contentType string) (format, error) {
// readMessage decodes a protobuf message from an HTTP request.
// Does not close the request body.
-func readMessage(r *http.Request, msg proto.Message) *httpError {
+func readMessage(r *http.Request, msg proto.Message) *protocolError {
if msg == nil {
- panicf("cannot decode to nil")
+ panic("cannot decode to nil")
}
format, err := requestFormat(r.Header.Get(headerContentType))
if err != nil {
@@ -96,7 +96,7 @@ func readMessage(r *http.Request, msg proto.Message) *httpError {
err = proto.UnmarshalText(string(buf), msg)
default:
- panicf("cannot happen")
+ panic("cannot happen")
}
if err != nil {
return errorf(http.StatusBadRequest, "could not decode body: %s", err)
« no previous file with comments | « server/prpc/auth.go ('k') | server/prpc/decoding_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698