add log grpc handler err (#1973)

Co-authored-by: wangxu <wangxu@oneniceapp.com>
This commit is contained in:
wangxu 2020-08-25 17:11:02 +08:00 committed by Vasiliy Tolstov
parent 724f1bcb70
commit a186c70446

View File

@ -194,6 +194,10 @@ func (g *grpcServer) handler(srv interface{}, stream grpc.ServerStream) (err err
logger.Error(string(debug.Stack())) logger.Error(string(debug.Stack()))
} }
err = errors.InternalServerError(g.opts.Name, "panic recovered: %v", r) err = errors.InternalServerError(g.opts.Name, "panic recovered: %v", r)
} else if err != nil {
if logger.V(logger.InfoLevel, logger.DefaultLogger) {
logger.Errorf("grpc handler got error: %s", err)
}
} }
}() }()