[#1247] object: Return NOT_FOUND
and ALREADY_REMOVED
statuses
Replace `ErrNotFound`/`ErrAlreadyRemoved` error from `pkg/core/object` package with `ObjectNotFound`/`ObjectAlreadyRemoved` one from `apistatus` package. These errors are returned by storage node's server as NeoFS API statuses. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f32c9670ad
commit
70ffdf3478
49 changed files with 348 additions and 178 deletions
|
@ -2,13 +2,13 @@ package blobstor
|
|||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"errors"
|
||||
"math/rand"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/object"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/util/logger/test"
|
||||
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
|
||||
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
|
||||
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
||||
|
@ -153,9 +153,9 @@ func TestBlobovniczas(t *testing.T) {
|
|||
gPrm.SetAddress(addrList[i])
|
||||
|
||||
_, err = b.get(gPrm)
|
||||
require.True(t, errors.Is(err, object.ErrNotFound))
|
||||
require.ErrorAs(t, err, new(apistatus.ObjectNotFound))
|
||||
|
||||
_, err = b.delete(dPrm)
|
||||
require.True(t, errors.Is(err, object.ErrNotFound))
|
||||
require.ErrorAs(t, err, new(apistatus.ObjectNotFound))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue