Skip to content

Commit

Permalink
report warnings as non fatal errors through Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashad Kanavath authored and nyalldawson committed Mar 20, 2019
1 parent c763b92 commit 0b86110
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/plugins/processing/algs/otb/OtbUtils.py
Expand Up @@ -39,6 +39,7 @@
from qgis.core import (Qgis, QgsApplication, QgsMessageLog)
from qgis.PyQt.QtCore import QCoreApplication


class OtbUtils:
# Checkbox to enable/disable otb provider (bool).
ACTIVATE = "OTB_ACTIVATE"
Expand Down Expand Up @@ -192,12 +193,13 @@ def executeOtb(commands, feedback, addToLog=True):
except:
pass
else:

if feedback is None:
QgsMessageLog.logMessage(line, OtbUtils.tr('Processing'), Qgis.Info)
else:
if any([l in line for l in ['(WARNING)', '(FATAL)', 'ERROR']]):
feedback.reportError(line)
if any([l in line for l in ['(WARNING)', 'WARNING:']]):
feedback.reportError(line, False)
elif any([l in line for l in ['(FATAL)', 'ERROR:', 'ERROR']]):
feedback.reportError(line, True)
else:
feedback.pushConsoleInfo(line.strip())

Expand Down

0 comments on commit 0b86110

Please sign in to comment.