Skip to content
Permalink
Browse files

Raise internal error if algorithm execution exception is not GeoAEE.

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@347 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com
cpolymeris@gmail.com committed Aug 13, 2012
1 parent cf2fca0 commit 0a29cc0a72a990c3ee30d5f30aca37bd44cdbea8
Showing with 13 additions and 7 deletions.
  1. +1 −1 src/sextante/core/Sextante.py
  2. +11 −5 src/sextante/gui/AlgorithmExecutor.py
  3. +1 −1 src/sextante/tests/runtests.sh
@@ -293,7 +293,7 @@ def runAlgorithm(algOrName, onFinish, *args):
SextanteLog.addToLog(SextanteLog.LOG_ALGORITHM, alg.getAsCommand())

QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
if SextanteConfig.getSetting(SextanteConfig.USE_THREADS) and onFinish:
if SextanteConfig.getSetting(SextanteConfig.USE_THREADS):
algEx = AlgorithmExecutor(alg)
progress = QProgressDialog()
progress.setWindowTitle(alg.name)
@@ -10,6 +10,7 @@ class AlgorithmExecutor(QThread):
percentageChanged = pyqtSignal(int)
textChanged = pyqtSignal(QString)
error = pyqtSignal(str)
internalError = pyqtSignal(BaseException)
iterated = pyqtSignal(int)
infoSet = pyqtSignal(str)
commandSet = pyqtSignal(str)
@@ -59,19 +60,24 @@ def setConsoleInfo(self, info):
del writer
else:
self.run = self.runalg
self.internalError.connect(self.raiseInternalError)

def raiseInternalError(self, error):
raise error

def runalg(self):
try:
self.algorithm.execute(self.progress)
except GeoAlgorithmExecutionException,e :
except GeoAlgorithmExecutionException as e :
self.error.emit(e.msg)
except Exception,e:
self.error.emit(str(e))
print str(e)
except BaseException as e:
self.internalError.emit(e)
# catch *all* errors, because QGIS tries to handle them in the GUI, which is fatal, this
# being a separate thread.
except:
self.error.emit("Error executing " + str(self.alg.name) + "\n" + sys.exc_info()[0])
msg = "Error executing " + str(self.alg.name) + "\n" + sys.exc_info()[0]
print msg
self.internalError.emit(msg)

def runalgIterating(self):
try:
@@ -1 +1 @@
QGISPATH=/usr/local PYTHONPATH=~/Proyectos/qgis/output/python/:~/Proyectos/qgis/python/plugins/ python test.py $@
QGISPATH=/usr/local PYTHONPATH=~/Proyectos/qgis/python/plugins/:~/Proyectos/qgis/output/python/ python test.py $@

0 comments on commit 0a29cc0

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