[#585] fstree: Return logical error if object deleted

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-08-10 18:46:24 +03:00
parent 0c52186572
commit baad49990c

View file

@ -429,6 +429,9 @@ func (t *FSTree) Get(ctx context.Context, prm common.GetPrm) (common.GetRes, err
data, err = os.ReadFile(p) data, err = os.ReadFile(p)
if err != nil { if err != nil {
if os.IsNotExist(err) {
return common.GetRes{}, logicerr.Wrap(new(apistatus.ObjectNotFound))
}
return common.GetRes{}, err return common.GetRes{}, err
} }
} }