Use xerrors
This commit is contained in:
parent
2facece1f6
commit
12baee0e57
@ -9,7 +9,7 @@ import (
|
||||
|
||||
logging "github.com/ipfs/go-log"
|
||||
manet "github.com/multiformats/go-multiaddr-net"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/xerrors"
|
||||
"gopkg.in/urfave/cli.v2"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/api"
|
||||
@ -34,7 +34,7 @@ func GetAPI(ctx *cli.Context) (api.FullNode, error) {
|
||||
|
||||
ma, err := r.APIEndpoint()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to get api endpoint")
|
||||
return nil, xerrors.Errorf("failed to get api endpoint: %w", err)
|
||||
}
|
||||
_, addr, err := manet.DialArgs(ma)
|
||||
if err != nil {
|
||||
|
@ -18,7 +18,6 @@ import (
|
||||
"github.com/mitchellh/go-homedir"
|
||||
"github.com/multiformats/go-base32"
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/chain/types"
|
||||
@ -37,7 +36,7 @@ const (
|
||||
|
||||
var log = logging.Logger("repo")
|
||||
|
||||
var ErrRepoExists = errors.New("repo exists")
|
||||
var ErrRepoExists = xerrors.New("repo exists")
|
||||
|
||||
// FsRepo is struct for repo, use NewFS to create
|
||||
type FsRepo struct {
|
||||
@ -115,7 +114,7 @@ func (fsr *FsRepo) APIEndpoint() (multiaddr.Multiaddr, error) {
|
||||
|
||||
data, err := ioutil.ReadAll(f)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to read %q", p)
|
||||
return nil, xerrors.Errorf("failed to read %q: %w", p, err)
|
||||
}
|
||||
strma := string(data)
|
||||
strma = strings.TrimSpace(strma)
|
||||
|
Loading…
Reference in New Issue
Block a user