[#1040] object: Wrap CheckAPE errors to status errors
All checks were successful
DCO action / DCO (pull_request) Successful in 5m31s
Vulncheck / Vulncheck (pull_request) Successful in 8m26s
Build / Build Components (1.21) (pull_request) Successful in 9m34s
Build / Build Components (1.20) (pull_request) Successful in 9m41s
Tests and linters / gopls check (pull_request) Successful in 10m53s
Tests and linters / Staticcheck (pull_request) Successful in 11m32s
Tests and linters / Lint (pull_request) Successful in 12m24s
Tests and linters / Tests (1.20) (pull_request) Successful in 13m13s
Tests and linters / Tests (1.21) (pull_request) Successful in 13m39s
Tests and linters / Tests with -race (pull_request) Successful in 15m8s

* 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
parent 63a29110ee
commit 457116494d

View file

@ -211,7 +211,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)
@ -249,7 +249,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
}
@ -303,7 +303,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)
@ -363,7 +363,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)
@ -372,7 +372,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
}