Skip to content

Commit

Permalink
only check connections XML if file can be parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Feb 27, 2015
1 parent c33c097 commit e0acd90
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions python/plugins/MetaSearch/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,16 @@ def get_connections_from_file(parent, filename):
error = 0
try:
doc = etree.parse(filename).getroot()
if doc.tag != 'qgsCSWConnections':
error = 1
msg = parent.tr('Invalid CSW connections XML.')
except etree.ParseError, err:
error = 1
msg = parent.tr('Cannot parse XML file: %s' % err)
except IOError, err:
error = 1
msg = parent.tr('Cannot open file: %s' % err)

if doc.tag != 'qgsCSWConnections':
error = 1
msg = parent.tr('Invalid CSW connections XML.')

if error == 1:
QMessageBox.information(parent, parent.tr('Loading Connections'), msg)
return
Expand Down

0 comments on commit e0acd90

Please sign in to comment.