question

Kelly Bennett avatar image
Kelly Bennett asked

Get original error behind ExecuteFunction

We have a bunch of Azure Functions which we've registered with PlayFab so we can call them using ExecuteFunction from within our game.

Our Azure Functions return with proper HTTP status codes when there are problems— however, the ExecuteFunction response is always either 200 or 400.

Is it possible to pass an HTTP status code all the way back through to the client?

CloudScript
10 |1200

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

Seth Du avatar image
Seth Du answered

Thanks for the feedback. I will discuss with team and send a report to the product team if possible. Meanwhile, please also feel free to send a thread on the feature request forum -- https://community.playfab.com/spaces/24/index.html.

10 |1200

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

Seth Du avatar image
Seth Du answered

If you didn’t implement try/catch block in the azure function, it is true that PlayFab API won’t return the detailed information about the error. Since usually it happens when the development, you may locally start streaming logs in Azure function project via Visual Stuido (Code) to track down the error lines. Otherwise, you need to make sure all errors are handled properly and return the error logs in the catch block. Please refer to Azure Functions reliable event processing | 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.

Kelly Bennett avatar image Kelly Bennett commented ·

@SethDu

Sorry if I wasn't clear.

I'm not saying that my Azure Function is throwing an error. I'm saying that the API will respond with various status codes, but that those status codes are not visible to the client.

For example: Say I have an Azure Function which returns an HTTP Status Code 429 when it's hit too frequently.

From PostMan I can verify that the endpoint does indeed return a 429 when I spam it like crazy

However, when I register that Azure Function with PlayFab and use PostMan to hit the Azure Function through ExecuteFunction, I never see a 429. Instead I see the same response that I see for all non-200 responses

{ "code": 400, "status": "BadRequest", "error": "CloudScriptAzureFunctionsHTTPRequestError", "errorCode": 1473, "errorMessage": "Invocation of cloud script function MatchStatus failed" }

My Client can not use this response to know to slow down polling my API, for example.

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.