diff --git a/rpc_util.go b/rpc_util.go index a6a11369c..35ac9cc7b 100644 --- a/rpc_util.go +++ b/rpc_util.go @@ -328,7 +328,7 @@ func recv(p *parser, c Codec, s *transport.Stream, dc Decompressor, m interface{ if len(d) > maxMsgSize { // TODO: Revisit the error code. Currently keep it consistent with java // implementation. - return Errorf(codes.Internal, "grpc: server received a message of %d bytes exceeding %d limit", len(d), maxMsgSize) + return Errorf(codes.Internal, "grpc: received a message of %d bytes exceeding %d limit", len(d), maxMsgSize) } if err := c.Unmarshal(d, m); err != nil { return Errorf(codes.Internal, "grpc: failed to unmarshal the received message %v", err) diff --git a/test/end2end_test.go b/test/end2end_test.go index c1953e56d..f6099d974 100644 --- a/test/end2end_test.go +++ b/test/end2end_test.go @@ -1100,7 +1100,7 @@ func testExceedMsgLimit(t *testing.T, e env) { Payload: payload, } if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.Internal { - t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: ", err, codes.Internal) + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %d", err, codes.Internal) } stream, err := tc.FullDuplexCall(te.ctx) @@ -1127,7 +1127,7 @@ func testExceedMsgLimit(t *testing.T, e env) { t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) } if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.Internal { - t.Fatalf("%v.Recv() = _, %v, want _, error code: ", stream, err, codes.Internal) + t.Fatalf("%v.Recv() = _, %v, want _, error code: %d", stream, err, codes.Internal) } }