question

Dylan Hunt avatar image
Dylan Hunt asked

Unity3D with C# - where is the playfab err code? Like 1000?

With JavaScript, it was `err.code`, but with C# .. there is only `err.httpcode` which is completely different (no details).

apis
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

In our Unity SDK, when we call your error callback, we pass a PlayFabError which contains all the information on the error that occurred.

4 comments
10 |1200

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

Dylan Hunt avatar image Dylan Hunt commented ·

Yes, but the PlayFabErr contains a COMBINATION of 3 different err descriptions, while JS and other libraries offer the ability to break it up. C# can do HTTP code, description (pretty for clients to see), but no code # and no keyword.

So I have to do PlayFabErr.ToString().StartsWith("AccountNotFound") which is really long and awkward instead of just doing PlayFabErr.Code

Error = "(InvalidFacebookToken, Invalid Facebook Token, 400 BadRequest)"

ErrorDetails = "" (blank - odd)

ErrorMessage = "Invalid Facebook Token"

HttpCode = 400

HttpStatus = "BadRequest"

That said, where is the breakdown for InvalidFacebookToken and 1000-something (the playfab internal code)?

0 Likes 0 ·
err.png (8.3 KiB)
brendan avatar image brendan Dylan Hunt commented ·

In Unity, PlayFabErrorCode is an enum listing all the possible error codes, and it is the Error element in PlayFabError. So for a callback function that uses "e" as the parameter name, it would be:

e.Error

Are you not seeing the error code there?

0 Likes 0 ·
Dylan Hunt avatar image Dylan Hunt brendan commented ·

Error always shows, but that's just for logs since it's not broken down -- but individually like Err.Message? ErrorMessage does not seem to be set for all errors and I believe this to be a bug.

For example: https://community.playfab.com/questions/5633/bug-playfaberror-emailaddressnotavailable-does-not.html

0 Likes 0 ·
Show more comments

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.