[#369] status: Support WRONG_MAGIC_NUMBER code and detail

Define constant for `WrongMagicNumber` local code. Define constant
`DetailIDCorrect` for correct magic detail. Add `ResetDetails`
and `AppendDetails` method pair. Replace `SetDetails` method with new
`SetStatusDetails` function which can be implemented using new methods.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-01-25 15:11:32 +03:00 committed by Alex Vanin
parent 959d1c8c38
commit 32dd0bb3f9
4 changed files with 27 additions and 4 deletions

View file

@ -37,7 +37,7 @@ func Status(empty bool) *status.Status {
if !empty {
m.SetCode(765)
m.SetMessage("some string")
m.SetDetails(Details(false))
status.SetStatusDetails(m, Details(false))
}
return m