question

Matt avatar image
Matt asked

How to get error from call from cloud

Hey guys,

So I'm making a call to UpdatePlayerStatistics from my cloud script. I want to check the return to see if that stat actually exists. The return of that function seems to be a UpdatePlayerStatisticsResult, but in my current definition file, it's an empty interface.

The docs page tells me one of the possible error codes is StatisticNotFound, which is exactly what I want. So simply put, how do I check for that error from cloud script?

Thanks!

-Matt

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

The StatisticNotFound error return for UpdatePlayerStatistics is actually part of work we are doing for a future update, to enable deletion of statistics. Currently, when you update a user statistic, we always attempt to create that statistic with a default definition, if it does not exist. I would recommend having a defined set of statistics that you use, but what specifically is the scenario in which you would not know whether or not a stat exists in your title?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt avatar image Matt commented ·

Ah that's fine then. As I add levels, I'll be adding the stats for the player's score in tandem, so the extra error checking I was going to make to be sure the level was legit I'll just leave out.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.