[#521] *: use stdlib errors package

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-05-18 11:12:51 +03:00 committed by Alex Vanin
parent 43e575cec2
commit 71b87155ef
171 changed files with 825 additions and 674 deletions

View file

@ -4,6 +4,7 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"math"
@ -22,7 +23,6 @@ import (
"github.com/nspcc-dev/neofs-api-go/pkg/object"
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
"github.com/nspcc-dev/neofs-node/pkg/policy"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
@ -307,7 +307,7 @@ var getContainerInfoCmd = &cobra.Command{
cnr = container.New()
if err := cnr.Unmarshal(data); err != nil {
return errors.Wrap(err, "can't unmarshal container")
return fmt.Errorf("can't unmarshal container: %w", err)
}
} else {
key, err := getKey()

View file

@ -7,7 +7,6 @@ import (
"github.com/nspcc-dev/neofs-api-go/util/signature"
"github.com/nspcc-dev/neofs-node/pkg/services/control"
controlSvc "github.com/nspcc-dev/neofs-node/pkg/services/control/server"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
@ -112,7 +111,7 @@ func setNetmapStatus(cmd *cobra.Command, _ []string) error {
switch netmapStatus {
default:
return errors.Errorf("unsupported status %s", netmapStatus)
return fmt.Errorf("unsupported status %s", netmapStatus)
case netmapStatusOnline:
status = control.NetmapStatus_ONLINE
case netmapStatusOffline:
@ -174,12 +173,12 @@ var dropObjectsCmd = &cobra.Command{
err := a.Parse(dropObjectsList[i])
if err != nil {
return errors.Wrapf(err, "could not parse address #%d", i)
return fmt.Errorf("could not parse address #%d: %w", i, err)
}
binAddr, err := a.Marshal()
if err != nil {
return errors.Wrap(err, "could not marshal the address")
return fmt.Errorf("could not marshal the address: %w", err)
}
binAddrList = append(binAddrList, binAddr)

View file

@ -2,6 +2,7 @@ package cmd
import (
"context"
"errors"
"fmt"
"github.com/nspcc-dev/neofs-api-go/pkg/client"
@ -10,7 +11,6 @@ import (
"github.com/nspcc-dev/neofs-api-go/pkg/token"
"github.com/nspcc-dev/neofs-node/pkg/core/object"
"github.com/nspcc-dev/neofs-node/pkg/services/object_manager/storagegroup"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)