Tutorial :What should you do if a required asset fails to load?


My program is in Flex but it doesn't really matter for the question I am asking. OK say I need to load an XML file for the application to work at all. If I capture an IOError while the xml file is loading, what logically should I do with that? The application needs it or the app is useless, so should I just keep re-trying on error, or should I notify the user to try again later? What would you do?



Ask the user what to do - Retry or Fail, with Fail meaning the app will close . If it makes sense, give the user a chance to browse to the resource.


It really depends on the nature of the file. If you know the file will exist at one time, it may make sense to wait for the file's creation (although this seems like a poor man's network model). However, in situations where an application is useless without a resource, I would fail unrecoverably and give meaningful error messages to the user, as well as log some debugging code to a file that the user could later submit for developer debugging.


Like GMail - do both. Notify the user when an error happens or a timeout is hit, and keep trying in the meantime.

Loading is taking longer than expected, retrying - please wait...  


Notify the user that the XML is not available, and offer the user the possibility to retry loading the XML, locate another XML or quit the application.


I don't think you should really try to many times that the page has noticeable lag. It really depends on whether the file being accessed is controlled by a third party or not and whether it is usually failing for large chunks of time or just say a second.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »