Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] If an exception occurs while processing a feature
in a feature-based algorithm, don't try to continue processing
remaining features

Avoids multiple error dialogs appearing for every feature
in a layer...
  • Loading branch information
nyalldawson committed Apr 3, 2018
1 parent f4445a0 commit 8326510
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/core/processing/qgsprocessingalgorithm.sip.in
Expand Up @@ -864,7 +864,7 @@ Returns the source's coordinate reference system. This will only return a valid
called from a subclasses' processFeature() implementation.
%End

virtual QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) = 0;
virtual QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) = 0 /VirtualErrorHandler=processing_exception_handler/;
%Docstring
Processes an individual input ``feature`` from the source. Algorithms should implement their
logic in this method for performing the algorithm's operation (e.g. replacing the feature's
Expand Down
2 changes: 1 addition & 1 deletion src/core/processing/qgsprocessingalgorithm.h
Expand Up @@ -897,7 +897,7 @@ class CORE_EXPORT QgsProcessingFeatureBasedAlgorithm : public QgsProcessingAlgor
* can break valid model execution - so use with extreme caution, and consider using
* \a feedback to instead report non-fatal processing failures for features instead.
*/
virtual QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) = 0;
virtual QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) = 0 SIP_VIRTUALERRORHANDLER( processing_exception_handler );

QVariantMap processAlgorithm( const QVariantMap &parameters,
QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
Expand Down

0 comments on commit 8326510

Please sign in to comment.