forked from TrueCloudLab/frostfs-node
[#521] *: use stdlib errors
package
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
43e575cec2
commit
71b87155ef
171 changed files with 825 additions and 674 deletions
|
@ -1,12 +1,12 @@
|
|||
package network
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
manet "github.com/multiformats/go-multiaddr/net"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
/*
|
||||
|
@ -40,7 +40,7 @@ func (a Address) String() string {
|
|||
func (a Address) IPAddrString() (string, error) {
|
||||
ip, err := manet.ToNetAddr(a.ma)
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "could not get net addr")
|
||||
return "", fmt.Errorf("could not get net addr: %w", err)
|
||||
}
|
||||
|
||||
return ip.String(), nil
|
||||
|
@ -50,7 +50,7 @@ func (a Address) IPAddrString() (string, error) {
|
|||
func (a Address) HostAddrString() (string, error) {
|
||||
_, host, err := manet.DialArgs(a.ma)
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "could not get host addr")
|
||||
return "", fmt.Errorf("could not get host addr: %w", err)
|
||||
}
|
||||
|
||||
return host, nil
|
||||
|
|
|
@ -2,12 +2,12 @@ package object
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/object"
|
||||
objectGRPC "github.com/nspcc-dev/neofs-api-go/v2/object/grpc"
|
||||
objectSvc "github.com/nspcc-dev/neofs-node/pkg/services/object"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Server wraps NeoFS API Object service and
|
||||
|
@ -34,7 +34,7 @@ func (s *Server) Put(gStream objectGRPC.ObjectService_PutServer) error {
|
|||
for {
|
||||
req, err := gStream.Recv()
|
||||
if err != nil {
|
||||
if errors.Is(errors.Cause(err), io.EOF) {
|
||||
if errors.Is(err, io.EOF) {
|
||||
resp, err := stream.CloseAndRecv()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue