|
33 | 33 | QSizePolicy,
|
34 | 34 | QDialogButtonBox)
|
35 | 35 |
|
36 |
| -from qgis.core import (QgsProcessingFeedback, |
37 |
| - QgsProcessingParameterDefinition) |
| 36 | +from qgis.core import ( |
| 37 | + QgsProcessingException, |
| 38 | + QgsProcessingFeedback, |
| 39 | + QgsProcessingParameterDefinition |
| 40 | +) |
38 | 41 | from qgis.gui import (QgsMessageBar,
|
39 | 42 | QgsProjectionSelectionWidget,
|
40 | 43 | QgsProcessingAlgorithmDialogBase,
|
@@ -140,9 +143,12 @@ def parametersHaveChanged(self):
|
140 | 143 | self.text.setPlainText('')
|
141 | 144 | return
|
142 | 145 |
|
143 |
| - commands = self.algorithm().getConsoleCommands(parameters, context, feedback, executing=False) |
144 |
| - commands = [c for c in commands if c not in ['cmd.exe', '/C ']] |
145 |
| - self.text.setPlainText(" ".join(commands)) |
| 146 | + try: |
| 147 | + commands = self.algorithm().getConsoleCommands(parameters, context, feedback, executing=False) |
| 148 | + commands = [c for c in commands if c not in ['cmd.exe', '/C ']] |
| 149 | + self.text.setPlainText(" ".join(commands)) |
| 150 | + except QgsProcessingException as e: |
| 151 | + self.text.setPlainText(str(e)) |
146 | 152 | except AlgorithmDialogBase.InvalidParameterValue as e:
|
147 | 153 | self.text.setPlainText(self.tr("Invalid value for parameter '{0}'").format(e.parameter.description()))
|
148 | 154 | except AlgorithmDialogBase.InvalidOutputExtension as e:
|
|
0 commit comments