Skip to main content
This tutorial shows how to access, recognize, and handle API errors using the PlayFab SDK. The practices described here are equally applicable to the admin, server, and client SDKs - but the patterns depend highly on the language of your choice. Simply put, the pattern of your choice will be valid for any SDK (admin/server/client) but implementation details will be specific to your programming language and environment.

Catching and accessing the error

PlayFab SDKs usually report errors by returning an error object. The following snippet shows how to detect and access the error.
Generally, if an error object is defined (not null), it indicates that an error has occurred. We may then further inspect the error.

Inspecting the error

The most common way to inspect an error is to recognize it through the code. As described in the Global API Method Error Codes, each generated error contains human-readable and numeric error codes.
The code on its own is sufficient to recognize and process the error accordingly.
Let’s take the LoginWithEmailAddress API method as an example. As stated in the documentation for this method, the following internal errors may be thrown upon execution:
  • InvalidTitleId 1004
  • AccountNotFound 1001
  • InvalidEmailOrPassword 1142
  • RequestViewConstraintParamsNotAllowed 1303
The following method illustrates how to inspect and recognize such an error.

Handling the error

Once the error is identified, the handle/recover strategy depends on the error type and nature. Errors such as invalid arguments will never succeed if retried. The request must be fixed for that API call to succeed. There is a sub-set of errors, where a retry strategy can be applied. Retry-able error types are described in the Global API Method Error Codes. Please make sure to meet the following requirements when applying a retry strategy:
  • With each retry, the delay between retries should increase exponentially. This increases your chances for a successful call, and prevents your game from spamming the PlayFab server (which will result in more rejected calls).
  • You should apply this retry strategy selectively, only using it for those codes that are worth retrying.
See our Global API Method Error Codes tutorial for a list of codes that are safe to retry.
Last modified on August 10, 2026