Start using error wrapping with fmt.Errorf (#8588)

Use fatih/errwrap to fix all the code to use
error wrapping with fmt.Errorf()
This commit is contained in:
Harshavardhana
2019-12-02 09:28:01 -08:00
committed by GitHub
parent 0bfd20a8e3
commit 5d3d57c12a
23 changed files with 113 additions and 112 deletions

View File

@@ -32,9 +32,9 @@ func etcdErrToErr(err error, etcdEndpoints []string) error {
}
switch err {
case context.DeadlineExceeded:
return fmt.Errorf("%s %s", errEtcdUnreachable, etcdEndpoints)
return fmt.Errorf("%w %s", errEtcdUnreachable, etcdEndpoints)
default:
return fmt.Errorf("unexpected error %s from etcd, please check your endpoints %s", err, etcdEndpoints)
return fmt.Errorf("unexpected error %w from etcd, please check your endpoints %s", err, etcdEndpoints)
}
}