question

brendan avatar image
brendan asked

Unknown error "Check your arguments" in Cloud Script

Question from a developer:

I'm working on adding some Cloud Script handlers to my game, but I've run into an issue where the debugger isn't sending me any info on why the script is failing. Have a look at the image below - all it tells me is to check the arguments. It's also clearly not running the script, as the execution time, memory, etc., are all 0.

CloudScript
capture.png (129.0 KiB)
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

For complex Cloud Scripts (or really, any non-trivial scripts), we highly recommend using TypeScript (https://api.playfab.com/blog/typescript2) to help with development, as it'll save you a lot of time and headache. For example, your revision 165 didn't actually have the Exception definition you had in previous revisions, but it was still trying to use it:

throw new Exception();

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

Ben avatar image Ben commented ·

We do use TypeScript, it really is great! I had manually modified the compiled JS while debugging though, I guess I missed the exception.

Anyway, I've compiled the project again using TypeScript fully, so it's not missing the exception any more. However the error is still occurring with no stack trace or other information.

0 Likes 0 ·
Ben avatar image Ben Ben commented ·

(this is revision 168)

0 Likes 0 ·
brendan avatar image brendan Ben commented ·

Could you have another look at the warnings TypeScript is generating for that example? Looking at that revision, we had to update the Holder0 to the following, in order to make TypeScript happy:

function Holder0(action, context): void {
    this.action = null;
    this.context = null;
    this.action = action;
    this.context = context;
}

There appear to be a number of places throughout the revision that should have similar updates. Once those have been resolved, I believe you won't have any issues.

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.