[#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:
Leonard Lyubich 2022-05-30 08:24:45 +03:00 committed by LeL
parent e96ea4635c
commit 96cdc04705

View file

@ -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
} }