forked from TrueCloudLab/frostfs-sdk-go
[#140] apistatus: Support CONTAINER_NOT_FOUND
error
Define `ContainerNotFound` type for `CONTAINER_NOT_FOUND` code. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f1e46d35de
commit
c627648798
3 changed files with 55 additions and 0 deletions
|
@ -3,6 +3,7 @@ package apistatus
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/container"
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/object"
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/status"
|
||||
)
|
||||
|
@ -67,6 +68,12 @@ func FromStatusV2(st *status.Status) Status {
|
|||
case object.StatusAlreadyRemoved:
|
||||
decoder = new(ObjectAlreadyRemoved)
|
||||
}
|
||||
case container.LocalizeFailStatus(&code):
|
||||
//nolint:exhaustive
|
||||
switch code {
|
||||
case container.StatusNotFound:
|
||||
decoder = new(ContainerNotFound)
|
||||
}
|
||||
}
|
||||
|
||||
if decoder == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue