-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
const std::shared_ptr<ModelAPI_Feature> & theFeature,
const std::string & theName,
const std::string & theExpression,
- const std::string & theComment)
+ const std::wstring & theComment)
: ModelHighAPI_Interface(theFeature)
{
if (initialize()) {
ParameterPtr addParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
const std::string & theName,
const std::string & theExpression,
- const std::string & theComment)
+ const std::wstring & theComment)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ParametersAPI_Parameter::ID());
- 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;
}
//--------------------------------------------------------------------------------------