frostfs-node/pkg/local_object_storage/shard/errors.go

25 lines
753 B
Go
Raw Normal View History

package shard
import (
"errors"
meta "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/metabase"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/util/logicerr"
apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status"
)
var ErrShardDisabled = logicerr.New("shard disabled")
// IsErrOutOfRange checks if an error returned by Shard GetRange method
// corresponds to exceeding the object bounds.
func IsErrOutOfRange(err error) bool {
var target *apistatus.ObjectOutOfRange
return errors.As(err, &target)
}
// IsErrObjectExpired checks if an error returned by Shard corresponds to
// expired object.
func IsErrObjectExpired(err error) bool {
return errors.Is(err, meta.ErrObjectIsExpired)
}