forked from TrueCloudLab/frostfs-node
70ffdf3478
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>
13 lines
302 B
Go
13 lines
302 B
Go
package meta
|
|
|
|
import (
|
|
"errors"
|
|
|
|
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
|
|
)
|
|
|
|
// IsErrRemoved checks if error returned by Shard Exists/Get/Put method
|
|
// corresponds to removed object.
|
|
func IsErrRemoved(err error) bool {
|
|
return errors.As(err, new(apistatus.ObjectAlreadyRemoved))
|
|
}
|