Dear PlayFab community,
I have run into a weird situation to which I'm hoping to find a solution:
I have the following CloudScript handler (with no arguments) and functions:
var Test = function(args: any, context?: IPlayFabContext): any | never { var result: any = TestNumber(); // TestString(); <-- This will fail! return result; } handlers["test"] = Test; function TestNumber(): number | undefined { return 1; } function TestString(): string | undefined { return "Test"; // undefined; <-- This will work. } function TestObject(): any | undefined { return {Test: "Test"}; }
When I execute "test" in a player context from the Dashboard, I get a SUCCESS when executing TestNumber() or TestObject() with the following information:
{ "FunctionResult": 1, "Logs": [], "ExecutionTimeSeconds": 0.0003232, "MemoryConsumedBytes": 10256, "APIRequestsIssued": 0, "HttpRequestsIssued": 0, "Error": null } { "FunctionResult": { "Test": "Test" }, "Logs": [], "ExecutionTimeSeconds": 0.0006081999999999999, "MemoryConsumedBytes": 9960, "APIRequestsIssued": 0, "HttpRequestsIssued": 0, "Error": null }
However, if I try to execute TestString(), I get the following ERROR:
{ "FunctionResult": null, "Logs": null, "ExecutionTimeSeconds": 0, "MemoryConsumedBytes": 0, "APIRequestsIssued": 0, "HttpRequestsIssued": 0, "Error": { "Error": null, "Message": "There was a problem running test. Check your arguments and try again.", "StackTrace": null } }
If I change LINE 15 to be:
return undefined;
Then TestString() will be successful.
If anyone has any ideas that I could try, I would be hugely obliged!
Thanks in advance!