Documentation snafu on sync function

Error in the documentation that cost me a couple hours…

I copied and pasted this example code, and started making requests, assuming that the function would be ok. Well, I couldn’t get my REST operations to upsert my documents and after eliminating everything on the REST side, I found that the sync function was tossing exceptions, and the error message on the gateway console was not helpful.

Through the process of commenting and un-commenting every line of code, it turned out that the line that was the problem was:

throw(forbidden: "Missing required properties");

Eventually, I saw the documentation on throw and it turns out we need curly brackets like so:

throw ({forbidden : "read only!"})

Please update the code in the example, so the next poor guy doesn’t have to waste his time like I did.

Kind regards,
David

Thanks for bringing that to our attention David, and apologies for your time wasted. I’ll make sure that gets fixed asap.

Adam