Skip to content
Permalink
Browse files

Improved error reporting for unknown parameters

  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 3, 2018
1 parent cdef548 commit a1fc70f88dadf1b4064a348939c74644f21a2f1a
Showing with 7 additions and 3 deletions.
  1. +7 −3 python/plugins/processing/modeler/ModelerParameterDefinitionDialog.py
@@ -16,6 +16,7 @@
* *
***************************************************************************
"""
from processing.modeler.exceptions import UndefinedParameterException

__author__ = 'Victor Olaya'
__date__ = 'August 2012'
@@ -399,9 +400,12 @@ def accept(self):
isinstance(self.param, QgsProcessingParameterCrs)):
self.param = QgsProcessingParameterCrs(name, description, self.selector.crs().authid())
else:
paramType = QgsApplication.instance().processingRegistry().parameterType(self.paramType)
self.param = paramType.create(name)
self.param.setMetadata(paramType.metadata())
paramTypeDef = QgsApplication.instance().processingRegistry().parameterType(self.paramType)
if not paramTypeDef:
msg = self.tr('The parameter `{}` is not registered, are you missing a required plugin?'.format(self.paramType))
raise UndefinedParameterException(msg)
self.param = paramTypeDef.create(name)
self.param.setMetadata(paramTypeDef.metadata())

if not self.requiredCheck.isChecked():
self.param.setFlags(self.param.flags() | QgsProcessingParameterDefinition.FlagOptional)

0 comments on commit a1fc70f

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