From e5d747dda333dda72e8eeec8b1dd27c55ef798c5 Mon Sep 17 00:00:00 2001 From: Jille Timmermans Date: Sat, 3 Jul 2021 13:07:51 +0100 Subject: [PATCH] binarylog: Don't continue after failing to marshal the proto and log the error as an Error rather than Info --- internal/binarylog/sink.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/binarylog/sink.go b/internal/binarylog/sink.go index f7c25104da5..587d67426a0 100644 --- a/internal/binarylog/sink.go +++ b/internal/binarylog/sink.go @@ -69,7 +69,8 @@ type writerSink struct { func (ws *writerSink) Write(e *pb.GrpcLogEntry) error { b, err := proto.Marshal(e) if err != nil { - grpclogLogger.Infof("binary logging: failed to marshal proto message: %v", err) + grpclogLogger.Errorf("binary logging: failed to marshal proto message: %v", err) + return err } hdr := make([]byte, 4) binary.BigEndian.PutUint32(hdr, uint32(len(b)))