- return ParameterPtr(new ParametersAPI_Parameter(aFeature, theName, theExpression, theComment));
+ ParameterPtr aParam(new ParametersAPI_Parameter(aFeature, theName, theExpression, theComment));
+
+ if (!aParam->feature()->error().empty())
+ {
+ std::string anError("Error with parameter \"");
+ anError += theName + "\": " + aParam->feature()->error();
+ throw anError;
+ }
+ return aParam;