[Greater-commits] r299 - trunk/Administration

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jun 29 12:38:46 CEST 2011


Author: aheinecke
Date: 2011-06-29 12:38:46 +0200 (Wed, 29 Jun 2011)
New Revision: 299

Modified:
   trunk/Administration/ImportDialog.cpp
Log:
Explicitly handle saxparseerror exceptions


Modified: trunk/Administration/ImportDialog.cpp
===================================================================
--- trunk/Administration/ImportDialog.cpp	2011-06-29 10:38:41 UTC (rev 298)
+++ trunk/Administration/ImportDialog.cpp	2011-06-29 10:38:46 UTC (rev 299)
@@ -489,6 +489,33 @@
 
   }
 
+  catch (const SAXParseException& e)
+  {
+    //Show error
+    message = wxString(XMLString::transcode(e.getMessage()), wxConvUTF8);
+
+    message = message.Format(wxT("An SAX error occured during parsing of the XML file."
+                                 "\nImport was stopped.\nException message: %s\n"
+                                 "on Line:%d Column:%d"),
+                                 message.c_str(), (int)e.getLineNumber(), (int)e.getColumnNumber());
+    ((MainWindow*) GetParent())->OnError(message);
+
+    /*
+    //
+    //Release memory for DOM objects
+    //
+    */ 
+
+    delete parser;
+    delete errHandler;
+    delete xmlfile;
+
+    //XMLPlatformUtils::Terminate();
+
+    return DA_FAIL;
+
+  }
+
   catch (...)
   {
     //Show error



More information about the Greater-commits mailing list