mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 13:55:17 +00:00
change use of errors.Wrap to fmt.Errorf with %w verb
Closes #4603 Commands used (VIM): ``` :args `rg -l errors.Wrap` :argdo normal @q | update ``` where q is a macros rewriting the `errors.Wrap` to `fmt.Errorf`.
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
package privval
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
tmnet "github.com/tendermint/tendermint/libs/net"
|
||||
@@ -15,10 +14,11 @@ import (
|
||||
// report that a connection timeout occurred. This detects both fundamental
|
||||
// network timeouts, as well as ErrConnTimeout errors.
|
||||
func IsConnTimeout(err error) bool {
|
||||
switch errors.Cause(err).(type) {
|
||||
case EndpointTimeoutError:
|
||||
_, ok := errors.Unwrap(err).(timeoutError)
|
||||
switch {
|
||||
case errors.As(err, &EndpointTimeoutError{}):
|
||||
return true
|
||||
case timeoutError:
|
||||
case ok:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user