add log grpc handler err (#1973)
Co-authored-by: wangxu <wangxu@oneniceapp.com>
This commit is contained in:
parent
724f1bcb70
commit
a186c70446
4
grpc.go
4
grpc.go
@ -194,6 +194,10 @@ func (g *grpcServer) handler(srv interface{}, stream grpc.ServerStream) (err err
|
||||
logger.Error(string(debug.Stack()))
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user