lint: add errchecks (#5316)

## Description

Work towards enabling errcheck

ref #5059
This commit is contained in:
Marko
2020-09-04 13:58:03 +02:00
committed by GitHub
parent 59ec3d91e4
commit b8d08b9ef4
43 changed files with 420 additions and 143 deletions

View File

@@ -911,11 +911,17 @@ func (n *Node) OnStop() {
n.Logger.Info("Stopping Node")
// first stop the non-reactor services
n.eventBus.Stop()
n.indexerService.Stop()
if err := n.eventBus.Stop(); err != nil {
n.Logger.Error("Error closing eventBus", "err", err)
}
if err := n.indexerService.Stop(); err != nil {
n.Logger.Error("Error closing indexerService", "err", err)
}
// now stop the reactors
n.sw.Stop()
if err := n.sw.Stop(); err != nil {
n.Logger.Error("Error closing switch", "err", err)
}
// stop mempool WAL
if n.config.Mempool.WalEnabled() {
@@ -937,7 +943,9 @@ func (n *Node) OnStop() {
}
if pvsc, ok := n.privValidator.(service.Service); ok {
pvsc.Stop()
if err := pvsc.Stop(); err != nil {
n.Logger.Error("Error closing private validator", "err", err)
}
}
if n.prometheusSrv != nil {