Error checking XML

(Moving forum as I am not sure it was in the best one to start with.)

Newbie Corona/Lua developer here.

I am using Jonathan Beebe’s XML parser:
http://blog.anscamobile.com/2011/07/how-to-use-xml-files-in-corona/

The problem that I am running into is that I don’t know if there is an error with the XML file processing.

For instance, I am retrieving an XML file based on the current date. I am using network.download to download the XML file. If the XML file doesn’t exist, I believe that it is saving the 404 page with the XML file name.

Then when I use xml:loadFile( xmlFilename, system.TemporaryDirectory ) to load the XML, it errors out:
[blockcode]
Runtime error
…PtGu84DtPZ+0Fiik+++TI/-Tmp-/TemporaryItems/3/xml.lua:86: XmlParser: trying to close img with td
stack traceback:
[C]: ?
[C]: in function ‘error’
…PtGu84DtPZ+0Fiik+++TI/-Tmp-/TemporaryItems/3/xml.lua:86: in function ‘ParseXmlText’
…PtGu84DtPZ+0Fiik+++TI/-Tmp-/TemporaryItems/3/xml.lua:113: in function ‘loadFile’
…tGu84DtPZ+0Fiik+++TI/-Tmp-/TemporaryItems/3/main.lua:28: in function <…tgu84dtpz>
[/blockcode]

How can I trap that error in the application? [import]uid: 17827 topic_id: 19652 reply_id: 319652[/import] </…tgu84dtpz>

I know that lack of error handling is one of the things that seems to annoy a lot of developers. No one has any thoughts on how to be able to catch this error? [import]uid: 17827 topic_id: 19652 reply_id: 76412[/import]