question

mark00 avatar image
mark00 asked

How to check for timeout error in cloudscript

Hi there,

As suggested elsewhere, I've been using leaderboards as a way to find opponents that have a similar score to the user. However with the recent leaderboards issue it's clear I need to add some more error handling in the event the leaderboard can't be reached.

I'm relatively new to coding and can't quite work out how to deal with a Playfab timeout error in Cloudscript. I looked at this but it didn't seem to help catch the timeout error.

Any help or pointers greatly appreciated.

Cheers.

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

·
Gosen Gao avatar image
Gosen Gao answered

When a CloudScript times out, it will cause the client API ExecuteCloudScript to generate an InternalServerError, and the detailed error message will be in the “Logs”. So if you want to handle the CloudScript timeout error, then you should check the result of ExecuteCloudScript. If there is an error, you can try to retry with an exponential delay back-off. For more info, you can refer to SDK error handling Best Practices - PlayFab | Microsoft Docs.

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.

mark00 avatar image mark00 commented ·

Perfect, thanks so much!

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.