forked from TrueCloudLab/frostfs-node
[#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
13
pkg/local_object_storage/writecache/errors.go
Normal file
13
pkg/local_object_storage/writecache/errors.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package writecache
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
|
||||
)
|
||||
|
||||
// IsErrNotFound checks if error returned by Cache Get/Head/Delete method
|
||||
// corresponds to missing object.
|
||||
func IsErrNotFound(err error) bool {
|
||||
return errors.As(err, new(apistatus.ObjectNotFound))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue