Skip to content


Browse files Browse the repository at this point in the history
Raise GeoAlgorithmExecutionException when encountering invalid
geometries in QgsProcessingUtils::getFeatures
  • Loading branch information
nyalldawson committed Apr 26, 2017
1 parent e6a33e8 commit f4f4ca3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/plugins/processing/tools/
Expand Up @@ -38,10 +38,12 @@
from qgis.core import (QgsApplication,
from qgis.PyQt.QtCore import (QCoreApplication)
from processing.core.Processing import Processing
from processing.core.parameters import ParameterSelection
from processing.gui.Postprocessing import handleAlgorithmResults
from processing.core.ProcessingConfig import ProcessingConfig
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException

def algorithmOptions(id):
Expand Down Expand Up @@ -111,4 +113,10 @@ def createContext():
invalid_features_method = ProcessingConfig.getSetting(ProcessingConfig.FILTER_INVALID_GEOMETRIES)

def raise_error(f):
raise GeoAlgorithmExecutionException(QCoreApplication.translate("FeatureIterator",
'Features with invalid geometries found. Please fix these geometries or specify the "Ignore invalid input features" flag'))


return context

0 comments on commit f4f4ca3

Please sign in to comment.