I'm currently developing a bugsense plugin for Corona. The function performing the request is:
local function sendLog(request)
local headers = {}
headers["Content-Type"] = "application/json"
headers["X-BugSense-Api-Key"] = "XXXXXXXXX"
local params = {}
params.headers = headers
params.body =json.encode(request)
network.request( "http://www.bugsense.com/api/errors", "POST", networkListener, params)
end
The request is executed perfectly, but API returns the following error:
{
"data": null,
"error": "list index out of range"
}
The petition sent to BUgsense is:
{
"client": {
"name": "bugsense-ios",
"version": "0.6"
},
"exception": {
"message": "XXXX",
"klass": "",
"where": "",
"backtrace": "XXXXX"
},
"application_environment": {
"appver": "2.0",
"uid": "XXXXX",
"mobile_net_on": "false",
"phone": "iPad",
"appname": "app",
"wifi_on": "false",
"osver": "10.9"
}
}
Obviously, all the XXXXX are replacing sensitive information.
Could anybody help me on what's wrong in the request to originate that error message?
Thanks in advance
Answering my own question for future references
The issue was generated because not all fields were included. All the fields in exception group must be included and non-empty. Even if the instructions from Bugsense are not indicating them as mandatory.
Hope this helps