object: Wrap CheckAPE errors to status errors #1040

Merged
fyrchik merged 1 commit from aarifullin/frostfs-node:fix/status_ape_errors into master 2024-03-14 07:34:08 +00:00

View file

@ -211,7 +211,7 @@ func (c *Service) Head(ctx context.Context, request *objectV2.HeadRequest) (*obj
SoftAPECheck: reqCtx.SoftAPECheck, SoftAPECheck: reqCtx.SoftAPECheck,
}) })
if err != nil { if err != nil {
return nil, err return nil, toStatusErr(err)
} }
resp, err := c.next.Head(ctx, request) 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, SoftAPECheck: reqCtx.SoftAPECheck,
}) })
if err != nil { if err != nil {
return nil, err return nil, toStatusErr(err)
} }
return resp, nil return resp, nil
} }
@ -303,7 +303,7 @@ func (c *Service) Delete(ctx context.Context, request *objectV2.DeleteRequest) (
SoftAPECheck: reqCtx.SoftAPECheck, SoftAPECheck: reqCtx.SoftAPECheck,
}) })
if err != nil { if err != nil {
return nil, err return nil, toStatusErr(err)
} }
resp, err := c.next.Delete(ctx, request) 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 { if err = c.apeChecker.CheckAPE(ctx, prm); err != nil {
return nil, err return nil, toStatusErr(err)
} }
resp, err := c.next.GetRangeHash(ctx, request) 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 { if err = c.apeChecker.CheckAPE(ctx, prm); err != nil {
return nil, err return nil, toStatusErr(err)
} }
return resp, nil return resp, nil
} }