Implement the error code hierarchy
The error codes are structured in a hierarchy. For example, Client.Authentication.Username is a Client.Authentication error, which is a Client side error. Error handling code should understand the different levels present in the error codes. This enables a client to correctly handle any future error codes. Suppose that we introduce a new error code ‘Client.Authentication.Foobar’, for example. An application unfamiliar with this specific error code can still handle it as a Client.Authentication error, starting a new session by logging in again or presenting its end users with a suitable message.
Use only error codes for error detection
Error responses might contain more specific information besides the error code (ie. ‘Input missing (Nickname)’ and ‘engine::identify_user_method::nickname_missing’). Do not rely on (parts of) these detailed descriptions, as they may be changed. Instead, use the error code (ie. ‘Client.Authentication.Username’) for determining the type and origin of the error.