mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Catch errors while running algs
This commit is contained in:
parent
df73a0f4fc
commit
be45c2fdbb
@ -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()
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user