From 213298c53fa833b168966de97d99539087f44b21 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 23 Dec 2024 14:53:04 +0300 Subject: [PATCH] [#1512] object: Make raw `PutSingle` check status within response Signed-off-by: Airat Arifullin --- pkg/services/object/put/single.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/services/object/put/single.go b/pkg/services/object/put/single.go index 36b0bd54c..19d025ff8 100644 --- a/pkg/services/object/put/single.go +++ b/pkg/services/object/put/single.go @@ -29,6 +29,7 @@ import ( sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" + apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" containerSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "git.frostfs.info/TrueCloudLab/tzhash/tz" @@ -353,6 +354,9 @@ func (s *Service) redirectPutSingleRequest(ctx context.Context, err = fmt.Errorf("response verification failed: %w", err) } + st := apistatus.FromStatusV2(resp.GetMetaHeader().GetStatus()) + err = apistatus.ErrFromStatus(st) + return })