question

Francois Boucher-Genesse avatar image
Francois Boucher-Genesse asked

Unity SDK doesn't allow developers to handle critical failures / exceptions

Hello,

There's an ongoing json deserialization issue that happens to a significant % of our android users, described here. I'm opening a new thread, as this issue is a related but separate.

In PlayFabUnityHttp.OnResponse(), the various try/catch will do a Debug.LogException and abort in case of an exception. The problem with this approach is that since the developer provided error callback is never called, there are no easy way for developers to know that this happened and to handle it gracefully.

In our case, we handle failures from most SDK calls properly using the error callbacks. For important calls, until we receive an answer (success or error callback), we're just showing a "please wait" prompt to the user. Because of the above mentioned json deserialization bug, this leads to an infinite "please wait" prompt.

While we could add a timeout for every important SDK call, this should be the responsability of the SDK itself, especially since it knows that it got an answer and that it failed in some way. As far as I can see, this is a problem everywhere there are Debug.LogException calls in the SDK.

To fix our specific issue, we modified the SDK to create a generic PlayfabError and send it with reqContainer.ErrorCallback. We do this for the 3 try/catch in PlayFabUnityHttp.OnResponse(). This way we can at least properly handle the error, retry the call if needed, silently ignore failures, etc.

This doesn't fix try/catch in other classes though, and I imagine this would be an issue for every developers. Are we missing something, or is this already slated to be fixed?

unity3dsdks
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

·
Made Wang avatar image
Made Wang answered

Thank you for raising this issue and we will report it to the development team.

10 |1200

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

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.