local function downloadListener( event ) if (event.response == nil) then print("event.response is nil") -- some error handling return end if ( event.isError ) then print( "download error" ) -- some error handling return end -- some handling for the download end local params = {} params.timeout = 10 network.download(theURL, "GET", downloadListener, params, myFilenamePrefix..data.id, system.TemporaryDirectory )
theURL is not a hardcoded URL, but a URL retrieved from a 3rd party API during run time. It varies every time. In 99% cases, it runs perfect. Only when the URL is considered malformed, I don’t get any callback, hence I can’t do further handling (for example, showing a message to the user that the download is failed)
FYI, the URL is considered malformed:
http://cdn.unwire.hk/wp-content/uploads/2013/09/Xiaomi2013-Keynote-PDF-20130905.pdf(頁面_21∕215)-590x382.jpeg
The question is, when a URL is considered invalid by network.download(), would there be any way to be notified about the error?