[Gambas-user] Try not catching XmlDocument Error

Lewis Balentine lewis at ...3412...
Fri Dec 5 11:43:04 CET 2014


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

[System]
Gambas=3.6.2
OperatingSystem=Linux
Kernel=3.13.0-24-generic
Architecture=x86_64
Distribution=Linux Mint 17 Qiana
Desktop=MATE
Theme=QGtk
Language=en_US.UTF-8
Memory=15994M
[Libraries]
Cairo=libcairo.so.2.11301.0
Curl=libcurl.so.4.3.0
DBus=libdbus-1.so.3.7.6
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.204.0
GTK+3=libgtk-3.so.0.1000.8
GTK+=libgtk-x11-2.0.so.0.2400.23
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.44.0.0
Qt4=libQtCore.so.4.8.6
SDL=libSDL-1.2.so.0.11.4




More information about the User mailing list