DNSManager: add some error messages.

beta
Philippe Pittoli 2023-06-30 01:10:52 +02:00
parent ad7ee31806
commit e77829b7a6
1 changed files with 29 additions and 0 deletions

View File

@ -109,6 +109,27 @@ type ErrorUserNotLogged = { }
codecErrorUserNotLogged ∷ CA.JsonCodec ErrorUserNotLogged codecErrorUserNotLogged ∷ CA.JsonCodec ErrorUserNotLogged
codecErrorUserNotLogged = CA.object "ErrorUserNotLogged" (CAR.record { }) codecErrorUserNotLogged = CA.object "ErrorUserNotLogged" (CAR.record { })
{- 5 -}
type DomainNotFound = { }
codecDomainNotFound :: CA.JsonCodec DomainNotFound
codecDomainNotFound = CA.object "DomainNotFound" (CAR.record { })
{- 6 -}
type RRNotFound = { }
codecRRNotFound :: CA.JsonCodec RRNotFound
codecRRNotFound = CA.object "RRNotFound" (CAR.record { })
{- 7 -}
type UnacceptableDomain = { }
codecUnacceptableDomain :: CA.JsonCodec UnacceptableDomain
codecUnacceptableDomain = CA.object "UnacceptableDomain" (CAR.record { })
{- 8 -}
type InvalidDomainName = { }
codecInvalidDomainName :: CA.JsonCodec InvalidDomainName
codecInvalidDomainName = CA.object "InvalidDomainName" (CAR.record { })
{- 10 -} {- 10 -}
-- For now, Error is just an alias on String. -- For now, Error is just an alias on String.
-- type InvalidZone = { errors : Array(Storage::Zone::Error) } -- type InvalidZone = { errors : Array(Storage::Zone::Error) }
@ -168,6 +189,10 @@ data AnswerMessage
| MkErrorInvalidToken ErrorInvalidToken -- 2 | MkErrorInvalidToken ErrorInvalidToken -- 2
| MkDomainAlreadyExists DomainAlreadyExists -- 3 | MkDomainAlreadyExists DomainAlreadyExists -- 3
| MkErrorUserNotLogged ErrorUserNotLogged -- 4 | MkErrorUserNotLogged ErrorUserNotLogged -- 4
| MkDomainNotFound DomainNotFound -- 5
| MkRRNotFound RRNotFound -- 6
| MkUnacceptableDomain UnacceptableDomain -- 7
| MkInvalidDomainName InvalidDomainName -- 8
| MkInvalidZone InvalidZone -- 10 | MkInvalidZone InvalidZone -- 10
| MkDomainChanged DomainChanged -- 11 | MkDomainChanged DomainChanged -- 11
| MkZone Zone -- 12 | MkZone Zone -- 12
@ -206,6 +231,10 @@ decode number string
2 -> error_management codecErrorInvalidToken MkErrorInvalidToken 2 -> error_management codecErrorInvalidToken MkErrorInvalidToken
3 -> error_management codecDomainAlreadyExists MkDomainAlreadyExists 3 -> error_management codecDomainAlreadyExists MkDomainAlreadyExists
4 -> error_management codecErrorUserNotLogged MkErrorUserNotLogged 4 -> error_management codecErrorUserNotLogged MkErrorUserNotLogged
5 -> error_management codecDomainNotFound MkDomainNotFound
6 -> error_management codecRRNotFound MkRRNotFound
7 -> error_management codecUnacceptableDomain MkUnacceptableDomain
8 -> error_management codecInvalidDomainName MkInvalidDomainName
10 -> error_management codecInvalidZone MkInvalidZone 10 -> error_management codecInvalidZone MkInvalidZone
11 -> error_management codecDomainChanged MkDomainChanged 11 -> error_management codecDomainChanged MkDomainChanged
12 -> error_management codecZone MkZone 12 -> error_management codecZone MkZone