From 839dead226534887ffbb21b07327724e42cd2135 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 16 Sep 2024 12:38:45 +0300 Subject: [PATCH] [#1297] getSvc: Return AccessDenied instead of ObjectNotFound Do not replace the access denied error if it was received earlier. Signed-off-by: Dmitrii Stepanov --- pkg/services/object/get/remote.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/object/get/remote.go b/pkg/services/object/get/remote.go index 163767c4..f2639f8e 100644 --- a/pkg/services/object/get/remote.go +++ b/pkg/services/object/get/remote.go @@ -41,7 +41,7 @@ func (r *request) processNode(ctx context.Context, info client.NodeInfo) bool { r.status = statusUndefined if errors.As(err, &errAccessDenied) { r.err = err - } else { + } else if r.err == nil || !errors.As(r.err, &errAccessDenied) { r.err = new(apistatus.ObjectNotFound) } }