replace errors.go with github.com/pkg/errors (2/2) (#3890)

* init of (2/2) common errors

* Remove instances of cmn.Error (2/2)

- Replace usage of cmnError and errorWrap
- ref #3862

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* comment wording

* simplify IsErrXXX functions

* log panic along with stopping the MConnection
This commit is contained in:
Marko
2019-08-11 19:03:40 +02:00
committed by Anton Kaliaev
parent 8dc39b69b7
commit 8a282a5fee
14 changed files with 75 additions and 88 deletions

View File

@ -1,15 +1,13 @@
package privval
import (
"fmt"
"testing"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
cmn "github.com/tendermint/tendermint/libs/common"
)
func TestIsConnTimeoutForNonTimeoutErrors(t *testing.T) {
assert.False(t, IsConnTimeout(cmn.ErrorWrap(ErrDialRetryMax, "max retries exceeded")))
assert.False(t, IsConnTimeout(fmt.Errorf("completely irrelevant error")))
assert.False(t, IsConnTimeout(errors.Wrap(ErrDialRetryMax, "max retries exceeded")))
assert.False(t, IsConnTimeout(errors.New("completely irrelevant error")))
}