From d7be70e93f851df42d573f7ef736359745e75f0f Mon Sep 17 00:00:00 2001 From: aarifullin Date: Tue, 12 Mar 2024 17:08:09 +0300 Subject: [PATCH] [#1040] object: Wrap CheckAPE errors to status errors * All methods should wrap CheckAPE error, if it occurs, to status error. Signed-off-by: Airat Arifullin --- pkg/services/object/ape/service.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/services/object/ape/service.go b/pkg/services/object/ape/service.go index cc18a0bc..8f45a8ff 100644 --- a/pkg/services/object/ape/service.go +++ b/pkg/services/object/ape/service.go @@ -214,7 +214,7 @@ func (c *Service) Head(ctx context.Context, request *objectV2.HeadRequest) (*obj SoftAPECheck: reqCtx.SoftAPECheck, }) if err != nil { - return nil, err + return nil, toStatusErr(err) } resp, err := c.next.Head(ctx, request) @@ -252,7 +252,7 @@ func (c *Service) Head(ctx context.Context, request *objectV2.HeadRequest) (*obj SoftAPECheck: reqCtx.SoftAPECheck, }) if err != nil { - return nil, err + return nil, toStatusErr(err) } return resp, nil } @@ -306,7 +306,7 @@ func (c *Service) Delete(ctx context.Context, request *objectV2.DeleteRequest) ( SoftAPECheck: reqCtx.SoftAPECheck, }) if err != nil { - return nil, err + return nil, toStatusErr(err) } resp, err := c.next.Delete(ctx, request) @@ -366,7 +366,7 @@ func (c *Service) GetRangeHash(ctx context.Context, request *objectV2.GetRangeHa } if err = c.apeChecker.CheckAPE(ctx, prm); err != nil { - return nil, err + return nil, toStatusErr(err) } resp, err := c.next.GetRangeHash(ctx, request) @@ -375,7 +375,7 @@ func (c *Service) GetRangeHash(ctx context.Context, request *objectV2.GetRangeHa } if err = c.apeChecker.CheckAPE(ctx, prm); err != nil { - return nil, err + return nil, toStatusErr(err) } return resp, nil }