Dear PlayFab community,
I'm wondering how to account for potential error codes returned from the server API when developing CloudScript code with TypeScript. For example, I want to capture the InvalidDropTable error code from the GetRandomResultTables() call:
https://api.playfab.com/documentation/server/method/GetRandomResultTables#error-codes
I see in the documentation that the response has a "code" and "status" fields. However, the TypeScript typings do not seem to have those properties defined. Is this an oversight of the typings? Should all *Result types be extending a base Result that has those properties? Is there an example of how I might be able to obtain this error information?
Thanks in advance!
Answer by Brendan · Oct 11, 2017 at 10:23 PM
Thanks, that's a fair point - we didn't include that, as failed API calls cause an exception to be thrown in Cloud Script. But if you're using try/catch, you might still want to work with those response values in the script directly. I've opened a work item for the tools team to look at adding that.