Then I would suggest that you start by ensuring that an invalid/inaccessible feed is not handled as a fatal error.
In
Parse.brs, change the readXml function to return Invalid if it cannot read and parse the Xml feed:
'
' Read an Xml document from a path (local file or remote url) and return an roXMLElement object
'
Function readXml (xmlPath As String) As Object
' Return an roXMLElement by parsing an Xml text file
xml = CreateObject ("roXMLElement")
' Read the Xml document from either a local file or a remote url
xmlString = _getPathToString (xmlPath, 5000)
'_debug ("xmlString: " + xmlString) ' un-comment to dump Xml file contents
If xmlString <> ""
If Not xml.Parse (xmlString)
REM uiFatalError ("readXml", LINE_NUM, "Unable to parse Xml document: " + xmlPath)
xml = Invalid
End If
Else
REM uiFatalError ("readXml", LINE_NUM, "Unable to read Xml document: " + xmlPath)
xml = Invalid
End If
Return xml
End Function
Next, it would probably be easier if parseXmlDocument returns Invalid for an invalid feed; it presently returns an empty associative array.
In Parse.brs change the following line in parseXmlDocument from:
contentItem = {}
to:
contentItem = Invalid
Then when you call parseXmlDocument in Main.brs, check for an Invalid return:
result = parseXmlDocument ("http ......)
if result = Invalid then result = parseXmlDocument ("http ......)