forked from TrueCloudLab/frostfs-node
[#1449] policer: Unwrap status HEAD response
Helper function `client.IsErrObjectNotFound` doesn't support error unwrapping, so we need to do it on caller side. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
e96ea4635c
commit
96cdc04705
1 changed files with 6 additions and 0 deletions
|
@ -2,6 +2,7 @@ package policer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/core/container"
|
"github.com/nspcc-dev/neofs-node/pkg/core/container"
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
|
||||||
|
@ -104,6 +105,11 @@ func (p *Policer) processNodes(ctx *processPlacementContext, addr *addressSDK.Ad
|
||||||
|
|
||||||
cancel()
|
cancel()
|
||||||
|
|
||||||
|
// client.IsErrObjectNotFound doesn't support wrapped errors, so unwrap it
|
||||||
|
for wErr := errors.Unwrap(err); wErr != nil; wErr = errors.Unwrap(err) {
|
||||||
|
err = wErr
|
||||||
|
}
|
||||||
|
|
||||||
if client.IsErrObjectNotFound(err) {
|
if client.IsErrObjectNotFound(err) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue