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.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.
InvalidTitleId 1004AccountNotFound 1001InvalidEmailOrPassword 1142RequestViewConstraintParamsNotAllowed 1303
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.
