Skip to content

Commit

Permalink
Catch errors while running algs
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 13, 2017
1 parent df73a0f commit be45c2f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions python/plugins/processing/core/GeoAlgorithm.py
Expand Up @@ -330,7 +330,7 @@ def executeAlgorithm(alg, parameters, context=None, feedback=None, model=None):
context = dataobjects.createContext()

#self.model = model
if True:
try:
#self.setOutputCRS()
#self.resolveOutputs()
#self.evaluateParameterValues()
Expand All @@ -341,12 +341,13 @@ def executeAlgorithm(alg, parameters, context=None, feedback=None, model=None):
return result
#self.convertUnsupportedFormats(context, feedback)
#self.runPostExecutionScript(feedback)
#except GeoAlgorithmExecutionException as gaee:
#lines = [self.tr('Error while executing algorithm')]
# lines = []
# lines.append(traceback.format_exc())
#QgsMessageLog.logMessage(gaee.msg, self.tr('Processing'), QgsMessageLog.CRITICAL)
#raise GeoAlgorithmExecutionException(gaee.msg, lines, gaee)
except GeoAlgorithmExecutionException as gaee:
lines = [self.tr('Error while executing algorithm')]
lines = []
lines.append(traceback.format_exc())
feedback.reportError(gaee.msg)
QgsMessageLog.logMessage(gaee.msg, self.tr('Processing'), QgsMessageLog.CRITICAL)
raise GeoAlgorithmExecutionException(gaee.msg, lines, gaee)
#except Exception as e:
# If something goes wrong and is not caught in the
# algorithm, we catch it here and wrap it
Expand Down

0 comments on commit be45c2f

Please sign in to comment.