forked from TrueCloudLab/frostfs-api-go
[#218] pkg/object: Define custom error for SplitInfo
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
1fdeca84e1
commit
e11b1728be
3 changed files with 54 additions and 2 deletions
|
@ -445,8 +445,9 @@ func (c *Client) getObjectV2(ctx context.Context, p *GetObjectParams, opts ...Ca
|
|||
} else {
|
||||
payload = append(payload, v.GetChunk()...)
|
||||
}
|
||||
case *v2object.SplitInfo: // what else can we do here?
|
||||
return nil, errors.New("object not found, split info has been provided")
|
||||
case *v2object.SplitInfo:
|
||||
si := object.NewSplitInfoFromV2(v)
|
||||
return nil, object.NewSplitInfoError(si)
|
||||
default:
|
||||
panic(fmt.Sprintf("unexpected Get object part type %T", v))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue