From feea11ed24951ecce5138da3f0c9019ff732d6f8 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 21 Jun 2012 00:56:55 +0000 Subject: [PATCH] Catch an exception that happens while aggregating a new scan. --- zenmap/zenmapGUI/ScanInterface.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/zenmap/zenmapGUI/ScanInterface.py b/zenmap/zenmapGUI/ScanInterface.py index 67b0b8f0a..4fe2d98fc 100644 --- a/zenmap/zenmapGUI/ScanInterface.py +++ b/zenmap/zenmapGUI/ScanInterface.py @@ -578,7 +578,17 @@ There was an error while parsing the XML file generated from the scan: parsed.unsaved = True self.scan_result.refresh_nmap_output() - self.inventory.add_scan(parsed) + try: + self.inventory.add_scan(parsed) + except Exception, e: + warn_dialog = HIGAlertDialog(message_format = _("Cannot merge scan"), + secondary_text = _(u"""\ +There was an error while merging the new scan's XML: + +%s\ +""") % str(e), type = gtk.MESSAGE_ERROR) + warn_dialog.run() + warn_dialog.destroy() parsed.set_xml_is_temp(command.xml_is_temp) self.collect_umit_info(command, parsed) parsed.nmap_output = command.get_output()