[#127] apistatus: Support WRONG_MAGIC_NUMBER status

Define `WrongMagicNumber` type for which encapsulates the work with
incorrect network magic. Provide method to read/write the correct magic
(which is a status detail in NeoFS API V2 protocol).

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-01-25 15:37:30 +03:00 committed by Alex Vanin
parent 883a26d210
commit 0fb22361a3
6 changed files with 121 additions and 3 deletions

View file

@ -44,6 +44,8 @@ func FromStatusV2(st *status.Status) Status {
switch status.LocalizeCommonFail(&code); code {
case status.Internal:
decoder = new(ServerInternal)
case status.WrongMagicNumber:
decoder = new(WrongMagicNumber)
}
}