[#1471] eacl: Prevent aborting on local storage failure

Request processing should not be interrupted in case of local storage
failure since error case in normal for relay nodes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-06-02 17:11:26 +03:00 committed by LeL
parent a97ea2aa21
commit 8b94cb22d3

View file

@ -11,7 +11,6 @@ import (
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
eaclSDK "github.com/nspcc-dev/neofs-sdk-go/eacl"
"github.com/nspcc-dev/neofs-sdk-go/object"
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
"github.com/nspcc-dev/neofs-sdk-go/user"
)
@ -187,22 +186,19 @@ func (h *cfg) objectHeaders() ([]eaclSDK.Header, error) {
}
func (h *cfg) localObjectHeaders(cnr cid.ID, idObj *oid.ID) ([]eaclSDK.Header, error) {
var obj *objectSDK.Object
var err error
if idObj != nil {
var addr oid.Address
addr.SetContainer(cnr)
addr.SetObject(*idObj)
obj, err = h.storage.Head(addr)
obj, err := h.storage.Head(addr)
if err == nil {
return headersFromObject(obj, cnr, idObj), nil
}
}
// Still parse addressHeaders, because the errors is ignored in some places.
return addressHeaders(cnr, idObj), err
return addressHeaders(cnr, idObj), nil
}
func cidHeader(idCnr cid.ID) sysObjHdr {