Lobby error messages
The Lobby service returns errors in the "problem details" format (RFC 7807) including some additional fields that are consistent with most other UGS services.
Example:
{
"title": "Bad Request",
"status": 400,
"code": 16000,
"detail": "request failed validation",
"details": [
{
"errorType": "validation",
"message": "count in body should be less than or equal to 100"
}
{
"errorType": "validation",
"message": "skip in body should be greater than or equal to 0"
}
],
"type": "http://unity3d/lobby/errors/validation-error"
}
Error Status
Field | Description |
---|---|
Code | A Unity services error code that uniquely identifies the type of error. |
Detail | A human-readable explanation specific to this occurrence of the problem. |
Details | A list of additional details about the specific error. See Error Details below. |
Status | The HTTP status code of the response. |
Title | A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. |
Type | A URI that identifies the problem type and may provide documentation for the problem. These URLs are currently non-functional |
Error Details
Field | Description |
---|---|
ErrorType | Represents the type of error detail. |
Message | Provides more information about the error. |
Error codes
The code
property of an error response from the Lobby service can be used to programmatically identify the type of
problem that has occurred. These are used by the SDK to automatically resolve certain issues (e.g. refreshing an
expired token, retrying a request that failed due to a transient error, etc.) and they are exposed to the developer in
the exceptions thrown by the SDK so that the client can react appropriately.
Common error codes will be in the range 0-999. These are usually seen when there is an issue with some component in between the client and the lobby service (such as network connectivity, an authentication failure, or rate limit). In cases where these aren't handled transparently, they will usually indicate more serious errors with the service and should generally be more rare.
Lobby specific error codes will be in the range 16000-16999. These are used to identify specific error cases in the
lobby service. Many of these are common and will occur during normal operation of the service and should be handled by
the game developer to provide a smooth user experience. For example, when performing a Join action you may see the
error LobbyNotFound
(16001
), which could just mean that the lobby you tried to join was deleted since the query
results were returned and the game client should handle this gracefully.
It may seem like there is some overlap between certain common and lobby specific error codes (NotFound
being the most
obvious example), but they should not be handled the same way. The common NotFound
error code likely indicates a
functional problem with the SDK or API client (such as an incorrectly configured request URL). You should examine the
error details for more information about the specific problem to identify how to resolve it.
Code | Name | Description |
---|---|---|
0 | Unknown | Unknown is returned when the server is unable to determine what the error is. |
1 | TransportError | TransportError is returned when there are DNS, TLS or other transport errors. |
2 | Timeout | Timeout is returned when no response was received in the allotted time causing the request to time out. |
3 | ServiceUnavailable | ServiceUnavailable is typically returned when the service is unavailable because the service is overloaded or down due to service maintenance. |
4 | ApiMissing | ApiMissing is returned when the API does not exist. |
5 | RequestRejected | RequestRejected is returned when the request was rejected before any request reaches the API. See Title and Details for more information. |
50 | TooManyRequests | TooManyRequests is returned when the request was rate limited because the client is making requests too frequently. See Lobby rate limits. |
51 | InvalidToken | InvalidToken is returned when the authentication token is invalid. |
52 | TokenExpired | TokenExpired is returned when the authentication token has expired. |
53 | Forbidden | Forbidden is returned when the user does not have permission to perform the requested operation. |
54 | NotFound | NotFound is returned when the requested resource was not found. |
55 | InvalidRequest | InvalidRequest is returned when the request was understood but the API refused to process it because of a request validation error. |
16000 | ValidationError | ValidationError is returned when there is a problem validating the user's request. The error details contain additional information about the problem. |
16001 | LobbyNotFound | LobbyNotFound is returned when the requested lobby was not found. |
16002 | PlayerNotFound | PlayerNotFound is returned when the requested player was not found in the lobby. |
16003 | LobbyConflict | LobbyConflict is returned when there was a conflict while trying to update the lobby. This could indicate that a player attempting to join a lobby was already a member, or there was an unresolvable issue while attempting to make some other update to the lobby. |
16004 | LobbyFull | LobbyFull is returned when the lobby that a user is trying to join already contains the maximum number of players. |
16005 | LobbyLocked | LobbyLocked is returned when the membership to the lobby has been locked and no new players can join. |
16006 | NoOpenLobbies | NoOpenLobbies is returned when a QuickJoin request was unable to find a lobby with available space for the user to join. |
16007 | LobbyAlreadyExists | LobbyAlreadyExists indicates that the Lobby cannot be created because it already exists. |
16008 | LobbyNotModified | LobbyNotModified indicates that the lobby resource has not been modified since the last observed version. |
16009 | IncorrectPassword | IncorrectPassword player attempted to join with a password that did not match the lobby's password. |
16010 | InvalidJoinCode | InvalidJoinCode indicates that a Join Code is not valid for some reason such as an invalid character. |