From 60c08fa386702327bd9fd9e3cc42749e5606422f Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 16 Jun 2017 16:39:52 -0700 Subject: [PATCH] Don't log AlreadyExists errors Signed-off-by: Michael Crosby --- services/content/service.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/services/content/service.go b/services/content/service.go index fb84d113c..c45830e72 100644 --- a/services/content/service.go +++ b/services/content/service.go @@ -238,13 +238,15 @@ func (s *Service) Write(session api.Content_WriteServer) (err error) { defer func(msg *api.WriteResponse) { // pump through the last message if no error was encountered if err != nil { - // TODO(stevvooe): Really need a log line here to track which - // errors are actually causing failure on the server side. May want - // to configure the service with an interceptor to make this work - // identically across all GRPC methods. - // - // This is pretty noisy, so we can remove it but leave it for now. - log.G(ctx).WithError(err).Error("(*Service).Write failed") + if grpc.Code(err) != codes.AlreadyExists { + // TODO(stevvooe): Really need a log line here to track which + // errors are actually causing failure on the server side. May want + // to configure the service with an interceptor to make this work + // identically across all GRPC methods. + // + // This is pretty noisy, so we can remove it but leave it for now. + log.G(ctx).WithError(err).Error("(*Service).Write failed") + } return }