From 96cdc047055edd1365c9382e7dfd691cd96d2eb7 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 30 May 2022 08:24:45 +0300 Subject: [PATCH] [#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 --- pkg/services/policer/check.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/services/policer/check.go b/pkg/services/policer/check.go index 72f7918aa..b3334ca58 100644 --- a/pkg/services/policer/check.go +++ b/pkg/services/policer/check.go @@ -2,6 +2,7 @@ package policer import ( "context" + "errors" "github.com/nspcc-dev/neofs-node/pkg/core/container" "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() + // 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) { continue }