forked from TrueCloudLab/frostfs-node
[#1969] local_object_storage: Add a type for logical errors
All logic errors are wrapped in `logicerr.Logical` type and do not affect shard error counter. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
98034005f1
commit
fcdbf5e509
42 changed files with 206 additions and 139 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobovnicza"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/common"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/util/logicerr"
|
||||
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -62,9 +63,7 @@ func (b *Blobovniczas) Delete(prm common.DeletePrm) (res common.DeleteRes, err e
|
|||
|
||||
if err == nil && !objectFound {
|
||||
// not found in any blobovnicza
|
||||
var errNotFound apistatus.ObjectNotFound
|
||||
|
||||
return common.DeleteRes{}, errNotFound
|
||||
return common.DeleteRes{}, logicerr.Wrap(apistatus.ObjectNotFound{})
|
||||
}
|
||||
|
||||
return
|
||||
|
@ -117,9 +116,7 @@ func (b *Blobovniczas) deleteObjectFromLevel(prm blobovnicza.DeletePrm, blzPath
|
|||
// and it's pointless to open them).
|
||||
if u64FromHexString(filepath.Base(blzPath)) > active.ind {
|
||||
b.log.Debug("index is too big", zap.String("path", blzPath))
|
||||
var errNotFound apistatus.ObjectNotFound
|
||||
|
||||
return common.DeleteRes{}, errNotFound
|
||||
return common.DeleteRes{}, logicerr.Wrap(apistatus.ObjectNotFound{})
|
||||
}
|
||||
|
||||
// open blobovnicza (cached inside)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue