Skip to content

Commit c2cad99

Browse files
committedJul 18, 2017
Add note about throwing QgsProcessingException to cancel algorithm execution
1 parent d926789 commit c2cad99

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
 

‎python/core/processing/qgsprocessingalgorithm.sip

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,11 @@ class QgsProcessingFeatureBasedAlgorithm : QgsProcessingAlgorithm
833833
The provided ``feedback`` object can be used to push messages to the log and for giving feedback
834834
to users. Note that handling of progress reports and algorithm cancelation is handled by
835835
the base class and subclasses do not need to reimplement this logic.
836+
837+
Algorithms can throw a QgsProcessingException if a fatal error occurred which should
838+
prevent the algorithm execution from continuing. This can be annoying for users though as it
839+
can break valid model execution - so use with extreme caution, and consider using
840+
``feedback`` to instead report non-fatal processing failures for features instead.
836841
:rtype: bool
837842
%End
838843

‎src/core/processing/qgsprocessingalgorithm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,11 @@ class CORE_EXPORT QgsProcessingFeatureBasedAlgorithm : public QgsProcessingAlgor
804804
* The provided \a feedback object can be used to push messages to the log and for giving feedback
805805
* to users. Note that handling of progress reports and algorithm cancelation is handled by
806806
* the base class and subclasses do not need to reimplement this logic.
807+
*
808+
* Algorithms can throw a QgsProcessingException if a fatal error occurred which should
809+
* prevent the algorithm execution from continuing. This can be annoying for users though as it
810+
* can break valid model execution - so use with extreme caution, and consider using
811+
* \a feedback to instead report non-fatal processing failures for features instead.
807812
*/
808813
virtual bool processFeature( QgsFeature &feature, QgsProcessingFeedback *feedback ) = 0;
809814

0 commit comments

Comments
 (0)
Please sign in to comment.