[#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 <a.arifullin@yadro.com>
This commit is contained in:
Airat Arifullin 2024-03-12 17:08:09 +03:00 committed by Evgenii Stratonikov
parent fb9219af39
commit d7be70e93f

View file

@ -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
}