[#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/shard"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/util/logicerr"
|
||||
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
|
||||
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
|
@ -90,8 +91,6 @@ func (e *StorageEngine) get(prm GetPrm) (GetRes, error) {
|
|||
case shard.IsErrNotFound(err):
|
||||
return false // ignore, go to next shard
|
||||
case errors.As(err, &siErr):
|
||||
siErr = err.(*objectSDK.SplitInfoError)
|
||||
|
||||
if outSI == nil {
|
||||
outSI = objectSDK.NewSplitInfo()
|
||||
}
|
||||
|
@ -128,7 +127,7 @@ func (e *StorageEngine) get(prm GetPrm) (GetRes, error) {
|
|||
})
|
||||
|
||||
if outSI != nil {
|
||||
return GetRes{}, objectSDK.NewSplitInfoError(outSI)
|
||||
return GetRes{}, logicerr.Wrap(objectSDK.NewSplitInfoError(outSI))
|
||||
}
|
||||
|
||||
if obj == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue