Skip to content
Permalink
Browse files

Better error reporting for model exception

  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 3, 2018
1 parent a337d20 commit 031aa9c0e418341c1c4a373d2385bdd6127f5c24
@@ -33,7 +33,7 @@
from qgis.core import QgsApplication, QgsSettings, QgsProcessingModelAlgorithm

from processing.gui.ToolboxAction import ToolboxAction
from processing.modeler.WrongModelException import WrongModelException
from processing.modeler.exceptions import WrongModelException
from processing.modeler.ModelerUtils import ModelerUtils

pluginPath = os.path.split(os.path.dirname(__file__))[0]
@@ -47,7 +47,7 @@
from processing.modeler.DeleteModelAction import DeleteModelAction
from processing.modeler.EditModelAction import EditModelAction
from processing.modeler.OpenModelFromFileAction import OpenModelFromFileAction
from processing.modeler.WrongModelException import WrongModelException
from processing.modeler.exceptions import WrongModelException
from processing.modeler.ModelerUtils import ModelerUtils

pluginPath = os.path.split(os.path.dirname(__file__))[0]
@@ -127,5 +127,5 @@ def loadFromFolder(self, folder):
QgsMessageLog.logMessage(self.tr('Could not load model {0}', 'ModelerAlgorithmProvider').format(descriptionFile),
self.tr('Processing'), Qgis.Critical)
except WrongModelException as e:
QgsMessageLog.logMessage(self.tr('Could not load model {0}\n{1}', 'ModelerAlgorithmProvider').format(descriptionFile, e.msg),
QgsMessageLog.logMessage(self.tr('Could not load model {0}\n{1}', 'ModelerAlgorithmProvider').format(descriptionFile, str(e)),
self.tr('Processing'), Qgis.Critical)
@@ -2,11 +2,11 @@

"""
***************************************************************************
WrongModelException.py
exceptions.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
Date : March 2018
Copyright : (C) 2018 by Matthias Kuhn
Email : matthias@opengis.ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
@@ -17,17 +17,10 @@
***************************************************************************
"""

__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'

# This will get replaced with a git SHA1 when you do a git archive

__revision__ = '$Format:%H$'


class WrongModelException(Exception):
pass


def __init__(self, msg):
Exception.__init__(self)
self.msg = msg
class UndefinedParameterException(Exception):
pass

0 comments on commit 031aa9c

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