From 1741eece9443ddb25c262a2e339698db1f483f17 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 16 Jan 2021 22:20:07 +0300 Subject: [PATCH] error when user handler returns not micro.Error or proto.Message error Signed-off-by: Vasiliy Tolstov --- grpc.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/grpc.go b/grpc.go index 7c09d4c..beb0559 100644 --- a/grpc.go +++ b/grpc.go @@ -579,11 +579,8 @@ func (g *grpcServer) processStream(stream grpc.ServerStream, service *service, m return err } default: - g.RLock() - config := g.opts - g.RUnlock() - if config.Logger.V(logger.ErrorLevel) { - config.Logger.Warn(config.Context, "handler error will not be transferred properly, must return *errors.Error or proto.Message") + if g.opts.Logger.V(logger.ErrorLevel) { + g.opts.Logger.Error(g.opts.Context, "handler error will not be transferred properly, must return *errors.Error or proto.Message") } // default case user pass own error type that not proto based statusCode = convertCode(verr)