forked from TrueCloudLab/frostfs-node
services/tree: Make error humane
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
20daa7d9dc
commit
851e410b83
1 changed files with 6 additions and 0 deletions
|
@ -20,6 +20,9 @@ func (s *Service) BurnedAdd(ctx context.Context, req *BurnedAddRequest) (*Burned
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if pos < 0 {
|
||||
return nil, errors.New("the node is not in the container")
|
||||
}
|
||||
|
||||
d := pilorama.CIDDescriptor{CID: cid, Position: pos, Size: len(ns)}
|
||||
meta := protoToMeta(b.GetMeta())
|
||||
|
@ -54,6 +57,9 @@ func (s *Service) BurnedRemove(ctx context.Context, req *BurnedRemoveRequest) (*
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if pos < 0 {
|
||||
return nil, errors.New("the node is not in the container")
|
||||
}
|
||||
|
||||
d := pilorama.CIDDescriptor{CID: cid, Position: pos, Size: len(ns)}
|
||||
key := b.GetKey()
|
||||
|
|
Loading…
Reference in a new issue