error when user handler returns not micro.Error or proto.Message error

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-01-16 22:20:07 +03:00
parent 4da14b61c1
commit 1741eece94

View File

@ -579,11 +579,8 @@ func (g *grpcServer) processStream(stream grpc.ServerStream, service *service, m
return err return err
} }
default: default:
g.RLock() if g.opts.Logger.V(logger.ErrorLevel) {
config := g.opts g.opts.Logger.Error(g.opts.Context, "handler error will not be transferred properly, must return *errors.Error or proto.Message")
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")
} }
// default case user pass own error type that not proto based // default case user pass own error type that not proto based
statusCode = convertCode(verr) statusCode = convertCode(verr)