[#315] apistatus: Write default message in NodeUnderMaintenance.Error
Use `node is under maintenance` message in `NodeUnderMaintenance.Error` is `message` field is unset in the status message. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
be9a1aca90
commit
f2f97f656d
1 changed files with 6 additions and 1 deletions
|
@ -183,9 +183,14 @@ type NodeUnderMaintenance struct {
|
|||
|
||||
// Error implements the error interface.
|
||||
func (x NodeUnderMaintenance) Error() string {
|
||||
msg := x.Message()
|
||||
if msg == "" {
|
||||
msg = "node is under maintenance"
|
||||
}
|
||||
|
||||
return errMessageStatusV2(
|
||||
globalizeCodeV2(status.NodeUnderMaintenance, status.GlobalizeCommonFail),
|
||||
x.v2.Message(),
|
||||
msg,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue