Skip to content

Commit 0b86110

Browse files
Rashad Kanavathnyalldawson
authored andcommitted
report warnings as non fatal errors through Feedback
1 parent c763b92 commit 0b86110

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

python/plugins/processing/algs/otb/OtbUtils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from qgis.core import (Qgis, QgsApplication, QgsMessageLog)
4040
from qgis.PyQt.QtCore import QCoreApplication
4141

42+
4243
class OtbUtils:
4344
# Checkbox to enable/disable otb provider (bool).
4445
ACTIVATE = "OTB_ACTIVATE"
@@ -192,12 +193,13 @@ def executeOtb(commands, feedback, addToLog=True):
192193
except:
193194
pass
194195
else:
195-
196196
if feedback is None:
197197
QgsMessageLog.logMessage(line, OtbUtils.tr('Processing'), Qgis.Info)
198198
else:
199-
if any([l in line for l in ['(WARNING)', '(FATAL)', 'ERROR']]):
200-
feedback.reportError(line)
199+
if any([l in line for l in ['(WARNING)', 'WARNING:']]):
200+
feedback.reportError(line, False)
201+
elif any([l in line for l in ['(FATAL)', 'ERROR:', 'ERROR']]):
202+
feedback.reportError(line, True)
201203
else:
202204
feedback.pushConsoleInfo(line.strip())
203205

0 commit comments

Comments
 (0)