frostfs-node/pkg/local_object_storage/blobovnicza/errors.go
Leonard Lyubich 70ffdf3478 [#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>
2022-03-17 16:34:00 +03:00

13 lines
307 B
Go

package blobovnicza
import (
"errors"
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
)
// IsErrNotFound checks if error returned by Blobovnicza Get/Delete method
// corresponds to missing object.
func IsErrNotFound(err error) bool {
return errors.As(err, new(apistatus.ObjectNotFound))
}