forked from TrueCloudLab/frostfs-sdk-go
[#140] apistatus: Support ACCESS_DENIED
error
Define `ObjectAccessDenied` type for `ACCESS_DENIED` code. Provide method to write/read human-readable reason. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
2b28f91a89
commit
3e94b7c892
4 changed files with 90 additions and 0 deletions
|
@ -71,6 +71,16 @@ func TestToStatusV2(t *testing.T) {
|
|||
}),
|
||||
codeV2: 2051,
|
||||
},
|
||||
{
|
||||
status: (statusConstructor)(func() apistatus.Status {
|
||||
var st apistatus.ObjectAccessDenied
|
||||
|
||||
st.WriteReason("any reason")
|
||||
|
||||
return st
|
||||
}),
|
||||
codeV2: 2048,
|
||||
},
|
||||
} {
|
||||
var st apistatus.Status
|
||||
|
||||
|
@ -161,6 +171,16 @@ func TestFromStatusV2(t *testing.T) {
|
|||
}),
|
||||
codeV2: 2051,
|
||||
},
|
||||
{
|
||||
status: (statusConstructor)(func() apistatus.Status {
|
||||
var st apistatus.ObjectAccessDenied
|
||||
|
||||
st.WriteReason("any reason")
|
||||
|
||||
return st
|
||||
}),
|
||||
codeV2: 2048,
|
||||
},
|
||||
} {
|
||||
var st apistatus.Status
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue