question

Chris Fitzpatrick avatar image
Chris Fitzpatrick asked

Return Actual Response from Azure Function in CloudScript

I would like to send different responses from my Azure Function to the client via PlayFab, but everything seems to be lost. A 404 and 414 errors, for example, getsreturned as just a 400 error. 301 redirects are also just 400 errors.

I've looked around it seems to be suggested as a workaround to just send a OK response with a JSON body that contains an error message. Client-side folks are not happy, to say the least.

Is there not a better way? Can I not send proper HTTP error codes in CloudScript?

apisCloudScript
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.

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

Currently, return an OkObjectResult that contains the error message is the best workaround.

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.