Skip to content

Commit

Permalink
Add note about throwing QgsProcessingException to cancel algorithm ex…
Browse files Browse the repository at this point in the history
…ecution
  • Loading branch information
nyalldawson committed Jul 18, 2017
1 parent d926789 commit c2cad99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/core/processing/qgsprocessingalgorithm.sip
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/core/processing/qgsprocessingalgorithm.h
Expand Up @@ -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;

Expand Down

0 comments on commit c2cad99

Please sign in to comment.