-- Alert Box Handler
local function onGenericAlertBox( event )
if "clicked" == event.action then
local i = event.index
if 1 == i then
end
end
return true
end

-- The Network Save Listener
local function CloudantNetworkListener( event )
-- You function needs to be bigger than this but this gives you an idea how to process data back from Cloudant.
local retval
local errorCaptured = false
if ( event.isError ) then
if errorCaptured == false then
--ERROR: Error during request, code: -1003, details: A server with the specified hostname could not be found.
print ( "NetworkError:isError RESPONSE: " .. event.response )
retval = native.showAlert( "Error submitting your event", "This is embarrassing. There was an error saving your request. Here is the raw error: " .. event.response, { "OK" }, onGenericAlertBox)
errorCaptured = true
end