[#140] apistatus: Support OBJECT_NOT_FOUND error

Define `ObjectNotFound` type for `OBJECT_NOT_FOUND` code.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-02-28 11:45:33 +03:00 committed by LeL
parent 3e94b7c892
commit ff3826ae6b
3 changed files with 44 additions and 0 deletions

View file

@ -81,6 +81,12 @@ func TestToStatusV2(t *testing.T) {
}),
codeV2: 2048,
},
{
status: (statusConstructor)(func() apistatus.Status {
return new(apistatus.ObjectNotFound)
}),
codeV2: 2049,
},
} {
var st apistatus.Status
@ -181,6 +187,12 @@ func TestFromStatusV2(t *testing.T) {
}),
codeV2: 2048,
},
{
status: (statusConstructor)(func() apistatus.Status {
return new(apistatus.ObjectNotFound)
}),
codeV2: 2049,
},
} {
var st apistatus.Status