forked from TrueCloudLab/frostfs-sdk-go
[#307] status: Support EACL_NOT_FOUND status code
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
a0f7c903d3
commit
7a99cc916c
6 changed files with 67 additions and 1 deletions
|
@ -34,3 +34,34 @@ func (x ContainerNotFound) ToStatusV2() *status.Status {
|
|||
x.v2.SetMessage("container not found")
|
||||
return &x.v2
|
||||
}
|
||||
|
||||
// EACLNotFound describes status of the failure because of the missing eACL
|
||||
// table.
|
||||
// Instances provide Status and StatusV2 interfaces.
|
||||
type EACLNotFound struct {
|
||||
v2 status.Status
|
||||
}
|
||||
|
||||
func (x EACLNotFound) Error() string {
|
||||
return errMessageStatusV2(
|
||||
globalizeCodeV2(container.StatusEACLNotFound, container.GlobalizeFail),
|
||||
x.v2.Message(),
|
||||
)
|
||||
}
|
||||
|
||||
// implements local interface defined in FromStatusV2 func.
|
||||
func (x *EACLNotFound) fromStatusV2(st *status.Status) {
|
||||
x.v2 = *st
|
||||
}
|
||||
|
||||
// ToStatusV2 implements StatusV2 interface method.
|
||||
// If the value was returned by FromStatusV2, returns the source message.
|
||||
// Otherwise, returns message with
|
||||
// * code: EACL_NOT_FOUND;
|
||||
// * string message: "eACL not found";
|
||||
// * details: empty.
|
||||
func (x EACLNotFound) ToStatusV2() *status.Status {
|
||||
x.v2.SetCode(globalizeCodeV2(container.StatusEACLNotFound, container.GlobalizeFail))
|
||||
x.v2.SetMessage("eACL not found")
|
||||
return &x.v2
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue