Skip to content
Permalink
Browse files

report warnings as non fatal errors through Feedback

  • Loading branch information
rkanavath authored and nyalldawson committed Mar 20, 2019
1 parent c763b92 commit 0b86110ccd5d6736fdb41405c4bbae4920672911
Showing with 5 additions and 3 deletions.
  1. +5 −3 python/plugins/processing/algs/otb/OtbUtils.py
@@ -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"
@@ -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())

0 comments on commit 0b86110

Please sign in to comment.
You can’t perform that action at this time.