GeoAlgorithmExecutionException -> QgsProcessingException

This commit is contained in:
Nyall Dawson 2017-08-15 17:08:29 +10:00 committed by Alexander Bruy
parent 65faf542e0
commit 1fc395b4fa

View File

@ -29,9 +29,9 @@ __revision__ = '$Format:%H$'
import os
import importlib
from qgis.core import (QgsProcessingUtils,
QgsProcessingException,
QgsMessageLog)
from processing.core.ProcessingConfig import ProcessingConfig
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import (getParameterFromString,
ParameterExtent,
ParameterRaster,
@ -162,7 +162,7 @@ class SagaAlgorithm(SagaAlgorithmBase):
filename = dataobjects.exportVectorLayer(layer)
self.exportedLayers[param.value] = filename
elif not parameters[param.name()].endswith('shp'):
raise GeoAlgorithmExecutionException(
raise QgsProcessingException(
self.tr('Unsupported file format'))
if isinstance(param, ParameterTable):
if param.name() not in parameters or parameters[param.name()] is None:
@ -172,7 +172,7 @@ class SagaAlgorithm(SagaAlgorithmBase):
filename = dataobjects.exportTable(table)
self.exportedLayers[parameters[param.name()]] = filename
elif not parameters[param.name()].endswith('shp'):
raise GeoAlgorithmExecutionException(
raise QgsProcessingException(
self.tr('Unsupported file format'))
if isinstance(param, ParameterMultipleInput):
if param.name() not in parameters or parameters[param.name()] is None:
@ -200,7 +200,7 @@ class SagaAlgorithm(SagaAlgorithmBase):
filename = dataobjects.exportVectorLayer(layer)
self.exportedLayers[layerfile] = filename
elif not layerfile.endswith('shp'):
raise GeoAlgorithmExecutionException(
raise QgsProcessingException(
self.tr('Unsupported file format'))
# TODO - set minimum extent