[Gambas-user] Try not catching XmlDocument Error

Adrien Prokopowicz adrien.prokopowicz at ...626...
Sat Dec 6 04:21:15 CET 2014


Le Fri, 05 Dec 2014 11:43:04 +0100, Lewis Balentine <lewis at ...3412...> a  
écrit:

> The problem is that the ".xml" file in question is malformed. It happens
> to have some lines after the end of the root element end tag. I was
> trying to add  code to handle the exception however Gambas terminates
> before entering the "If Error" code. This behavior is consistent.
>
> Error message: terminate called after throwing an instance of
> 'XMLParseException*'
>
> Begin Sample code:---------------------------------------
> Private Sub ProcessOneTitanFile(TitanFileName As String)
>    Dim TitanXML As New XmlDocument
>
>    Print TitanFileName    ' needed to find offending file.
>    Try TitanXML.Open(TitanFileName)
>    If Error Then
>      Print "*** FATAL ERROR *** SUB ProcessOneTitanFile."
>      Print "*** FATAL ERROR *** trying to open XML file."
>      Quit
>    Endif
>    ' other code follows
>    End
> End Sample code:---------------------------------------
>
> regards,
>
> Lewis Balentine
> [...]

Hello Lewis,

Revision #6711 should fix this problem. Can you confirm ?

Regards,
-- 
Adrien Prokopowicz




More information about the User mailing list