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 GitHub
parent bf8b3aeac7
commit 3a96135df8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}
}
}()