Firstly, the version of mod_coronium.lua that I am using is v1.92.5 which is the most recent, I believe.
And, my server is an AWS EC2 t2.micro instance running Coronium Cloud Platform 1.93.1 but, as previously mentioned, my failing client code was getting nowhere near it.
Secondly, I fixed the fault – I think. I have no explanation for why my fix works; I will explain…
I ran the failing code within Sublime Text 3 and got the exact same failure for the same reason, so the error was not specific to ZeroBrane.
However, Sublime has superior syntax highlighting – at least as I have the 2 tools configured – as it shows function declarations in green and function calls in blue.
The failing function call (on line 424 ) was being highlighted as a declaration; when I changed the 3rd parameter to network.request() from being a closure this corrected itself (but, of course, stuffed up the code).
I noticed that a previous similar call, to network.upload() (on line 292 ), is correctly highlighted and has all its parameters on subsequent lines. I moved the parameters of the failing call (line 424 ) to the next line and not only did the highlighting correct itself but the code now ran correctly ! (I now have records on my AWS server instance.)
local q = {
requestId = network.request (
uri, action, function (e) Coronium:onResponse(e); end , requestParams ),
requestType = requestType,
_callback = _callback,
}
I am not a fan of “magic” happening in code; I would be delighted and very grateful if any clever person can explain this fix.
Edit: I forgot to mention that I am developing/running my client on a Windows 10 machine.
I also moved parameters to the next line for the other call to network.request() on line 461.
Additionally, as part of my mucking around, I updated my Corona SDK from 2015.2731 (circa Oct 2015) to the most recent public release (2016.2830).
Chris Bargh