Error codes

Every error has a stable code. The SDKs use the same codes (Unity as an enum), plus a few for problems that happen before a request reaches the server.

On this page

API errors#

CodeHTTPUnityWhenRetry?
validation400, 422ValidationInvalid input; details.fields names the field.No
unauthorized401UnauthorizedWrong keys, or a missing, expired or revoked player token.No
forbidden403ForbiddenSuspended project, a server-only endpoint, or HTTPS required.No
plan_limit403PlanLimitA plan limit was reached (players, entries, storage…). Nothing is deleted.No
not_found404NotFoundUnknown endpoint, leaderboard, player or save key.No
conflict409ConflictAlready done, e.g. a reward already claimed this period.No
revision_mismatch409RevisionMismatchA cloud save changed on another device.No
rate_limited429RateLimitedToo many requests per minute, or a leaderboard cooldown. Wait Retry-After seconds.Yes
quota_exceeded429QuotaExceededThe account's daily request quota is used up; it resets at 00:00 UTC.No
server_error500ServerErrorSomething failed on the server. Safe requests are retried by the SDKs.Yes

SDK-only errors#

CodeHTTPUnityWhenRetry?
network—NetworkThe server could not be reached.Yes
timeout—TimeoutThe request took longer than the timeout.Yes
not_configured—NotConfiguredBase URL, Project ID or client key missing or invalid.No
not_signed_in—NotSignedInA player call before signing in, or after the session expired.No
signature_invalid—SignatureInvalidRemote config failed verification and was not used.No
parse_error—ParseErrorThe response could not be read (usually a proxy or an HTML error page).No
link_expired—LinkExpiredThe account-linking page expired; start again.No
link_cancelled—LinkCancelledThe account-linking flow was cancelled.No

Handling errors#

Show message to developers, not players; switch on the code. Retry only retryable errors, and log the request ID so you can find the request on the Logs page.

C#
var top = await Majacloud.Leaderboards.GetTopAsync("coins", 10);
if (top.Ok)
{
    foreach (var entry in top.Value.Entries)
        Debug.Log($"#{entry.Rank} {entry.PlayerName} {entry.Score}");
}
else if (top.Error.IsRetryable)
{
    // Network, timeout, 5xx or rate limit: try again later
    Debug.Log("Retry in " + top.Error.RetryAfterSeconds + " s");
}
else
{
    Debug.LogWarning(top.Error.Code + ": " + top.Error.Message + " (" + top.Error.RequestId + ")");
}

Search page titles, headings and text.

↑↓ to navigate ↵ to open Esc to close