mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
safeguard cases where the CSW record output is erroneous
This commit is contained in:
parent
a41094d42e
commit
ada01603cb
@ -518,7 +518,13 @@ class MetaSearchDialog(QDialog, BASE_CLASS):
|
|||||||
return
|
return
|
||||||
|
|
||||||
identifier = get_item_data(item, 'identifier')
|
identifier = get_item_data(item, 'identifier')
|
||||||
record = self.catalog.records[identifier]
|
try:
|
||||||
|
record = self.catalog.records[identifier]
|
||||||
|
except KeyError, err:
|
||||||
|
QMessageBox.warning(self,
|
||||||
|
self.tr('Record parsing error'),
|
||||||
|
'Unable to locate record identifier')
|
||||||
|
return
|
||||||
|
|
||||||
# if the record has a bbox, show a footprint on the map
|
# if the record has a bbox, show a footprint on the map
|
||||||
if record.bbox is not None:
|
if record.bbox is not None:
|
||||||
@ -734,6 +740,12 @@ class MetaSearchDialog(QDialog, BASE_CLASS):
|
|||||||
QMessageBox.warning(self, self.tr('GetRecords error'),
|
QMessageBox.warning(self, self.tr('GetRecords error'),
|
||||||
self.tr('Error getting response: %s') % err)
|
self.tr('Error getting response: %s') % err)
|
||||||
return
|
return
|
||||||
|
except KeyError, err:
|
||||||
|
QMessageBox.warning(self,
|
||||||
|
self.tr('Record parsing error'),
|
||||||
|
'Unable to locate record identifier')
|
||||||
|
QApplication.restoreOverrideCursor()
|
||||||
|
return
|
||||||
|
|
||||||
QApplication.restoreOverrideCursor()
|
QApplication.restoreOverrideCursor()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user