Please consider following network download listener, it’s a typical one
local function picDownloadListener(event) if (event.response == nil) then return end if ( event.isError ) then return elseif ( event.phase == "ended" ) then local proPicObj = display.newImage(event.response.filename, event.response.baseDirectory) print("filename/base, event.response.filename, event.response.baseDirectory) end end
After calling network.download(), in most cases, the result is fine. However, there is a rare case that these two variables are nil:
event.response.filename
event.response.baseDirectory
If the download fails, shouldn’t event.reponse or event.isError should have caught it? How could these two values are nil (& the file is actually not downloaded) while no error is returned?
Any thought?