3434 QgsFeatureRequest ,
3535 QgsFeatureSink ,
3636 QgsProcessing ,
37+ QgsProcessingException ,
3738 QgsProcessingParameterMultipleLayers ,
3839 QgsProcessingParameterFeatureSink ,
3940 QgsMapLayer )
4041
4142from processing .algs .qgis .QgisAlgorithm import QgisAlgorithm
42- from processing .core .GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
4343
4444pluginPath = os .path .split (os .path .split (os .path .dirname (__file__ ))[0 ])[0 ]
4545
@@ -78,12 +78,12 @@ def processAlgorithm(self, parameters, context, feedback):
7878 totalFeatureCount = 0
7979 for layer in input_layers :
8080 if layer .type () != QgsMapLayer .VectorLayer :
81- raise GeoAlgorithmExecutionException (
81+ raise QgsProcessingException (
8282 self .tr ('All layers must be vector layers!' ))
8383
8484 if (len (layers ) > 0 ):
8585 if (layer .wkbType () != layers [0 ].wkbType ()):
86- raise GeoAlgorithmExecutionException (
86+ raise QgsProcessingException (
8787 self .tr ('All layers must have same geometry type!' ))
8888
8989 layers .append (layer )
@@ -95,7 +95,7 @@ def processAlgorithm(self, parameters, context, feedback):
9595 if (dfield .name ().upper () == sfield .name ().upper ()):
9696 found = dfield
9797 if (dfield .type () != sfield .type ()):
98- raise GeoAlgorithmExecutionException (
98+ raise QgsProcessingException (
9999 self .tr ('{} field in layer {} has different '
100100 'data type than in other layers.' .format (sfield .name (), layerSource )))
101101
@@ -142,7 +142,7 @@ def processAlgorithm(self, parameters, context, feedback):
142142 for sindex , sfield in enumerate (layer .fields ()):
143143 if (sfield .name ().upper () == dfield .name ().upper ()):
144144 if (sfield .type () != dfield .type ()):
145- raise GeoAlgorithmExecutionException (
145+ raise QgsProcessingException (
146146 self .tr ('Attribute type mismatch' ))
147147 dattribute = sattributes [sindex ]
148148 break
0 commit comments