Skip to content
Permalink
Browse files

Add note about throwing QgsProcessingException to cancel algorithm ex…

…ecution
  • Loading branch information
nyalldawson committed Jul 18, 2017
1 parent d926789 commit c2cad99d6b18f22a0dd3981a372b9dbeb07b97af
Showing with 10 additions and 0 deletions.
  1. +5 −0 python/core/processing/qgsprocessingalgorithm.sip
  2. +5 −0 src/core/processing/qgsprocessingalgorithm.h
@@ -833,6 +833,11 @@ class QgsProcessingFeatureBasedAlgorithm : QgsProcessingAlgorithm
The provided ``feedback`` object can be used to push messages to the log and for giving feedback
to users. Note that handling of progress reports and algorithm cancelation is handled by
the base class and subclasses do not need to reimplement this logic.

Algorithms can throw a QgsProcessingException if a fatal error occurred which should
prevent the algorithm execution from continuing. This can be annoying for users though as it
can break valid model execution - so use with extreme caution, and consider using
``feedback`` to instead report non-fatal processing failures for features instead.
:rtype: bool
%End

@@ -804,6 +804,11 @@ class CORE_EXPORT QgsProcessingFeatureBasedAlgorithm : public QgsProcessingAlgor
* The provided \a feedback object can be used to push messages to the log and for giving feedback
* to users. Note that handling of progress reports and algorithm cancelation is handled by
* the base class and subclasses do not need to reimplement this logic.
*
* Algorithms can throw a QgsProcessingException if a fatal error occurred which should
* prevent the algorithm execution from continuing. This can be annoying for users though as it
* 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 bool processFeature( QgsFeature &feature, QgsProcessingFeedback *feedback ) = 0;

0 comments on commit c2cad99

Please sign in to comment.
You can’t perform that action at this time.