mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-18 22:14:35 +00:00
lint: add errchecks (#5316)
## Description Work towards enabling errcheck ref #5059
This commit is contained in:
+12
-4
@@ -157,16 +157,24 @@ func (app *multiAppConn) killTMOnClientError() {
|
||||
|
||||
func (app *multiAppConn) stopAllClients() {
|
||||
if app.consensusConnClient != nil {
|
||||
app.consensusConnClient.Stop()
|
||||
if err := app.consensusConnClient.Stop(); err != nil {
|
||||
app.Logger.Error("error while stopping consensus client", "error", err)
|
||||
}
|
||||
}
|
||||
if app.mempoolConnClient != nil {
|
||||
app.mempoolConnClient.Stop()
|
||||
if err := app.mempoolConnClient.Stop(); err != nil {
|
||||
app.Logger.Error("error while stopping mempool client", "error", err)
|
||||
}
|
||||
}
|
||||
if app.queryConnClient != nil {
|
||||
app.queryConnClient.Stop()
|
||||
if err := app.queryConnClient.Stop(); err != nil {
|
||||
app.Logger.Error("error while stopping query client", "error", err)
|
||||
}
|
||||
}
|
||||
if app.snapshotConnClient != nil {
|
||||
app.snapshotConnClient.Stop()
|
||||
if err := app.snapshotConnClient.Stop(); err != nil {
|
||||
app.Logger.Error("error while stopping snapshot client", "error", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ func TestAppConns_Start_Stop(t *testing.T) {
|
||||
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
appConns.Stop()
|
||||
err = appConns.Stop()
|
||||
require.NoError(t, err)
|
||||
|
||||
clientMock.AssertExpectations(t)
|
||||
}
|
||||
@@ -71,7 +72,11 @@ func TestAppConns_Failure(t *testing.T) {
|
||||
|
||||
err := appConns.Start()
|
||||
require.NoError(t, err)
|
||||
defer appConns.Stop()
|
||||
t.Cleanup(func() {
|
||||
if err := appConns.Stop(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
})
|
||||
|
||||
// simulate failure
|
||||
close(quitCh)
|
||||
|
||||
Reference in New Issue
Block a user