Errors

Errors are sent with the [Error] header. Every error has a Type parameter, which is one of:
Compatibility, Game, HighLevel, Syntax.

Compatibility

[Error]
Type=Compatibility
SpecVersion=0.0.2
RequiredSpecVersion=0.0.2

This is sent if either the client's spec version is too old or is older than the server's. If sent, this is sent in response to [Hello] instead of [Hi]

Game

[Error]
Type=Game
Details=…
…=…

This is sent for errors specific to a game. An example would be using an invalid cup in Oware. The Details parameter should be human readable, such as Invalid cup instead of InvalidCup, but it doesn't have to be in sentence form, like Cup is invalid. The idea is that if the error is unrecognized by the client, it can just take the value of the Details parameter, but it doesn't have to be perfect. Never use error codes.

The detailed specification should be on the relevant wiki page for the game.

HighLevel

[Error]
Type=HighLevel
Details=…
…=…

This is sent if there is an error relating to the game, but not specific to a type of game. An example would be a name being taken when joining a game or trying to do something that you can only do while in a game, when not in a game, such as sending a message or making a move.

Details=You already joined a game
Self-explanatory.

Details=Game does not exist
The game identified by the Id parameter in [Join] does not exist.

Details=Game is full
Self-explanatory.

Details=Illegal name (] or ;)
For various reasons, the characters ] and ; are forbidden.

Details=Illegal name (obscenity)
If a server wants to block obscenity in its users' name, this is how it reports the error.

Details=Name taken
Users=A;B;C;…
Self-explanatory.

Details=Not a user
If a client is trying to do a game-specific move or send a message before it joined the game, the server sends this error.

Syntax

Details=…

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License