]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModelHighAPI/ModelHighAPI_Selection.cpp
Salome HOME
Issue #2044: Error detection in the parametric API
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Selection.cpp
index e446cff41b16ea33f764baf76007f2fb14d22a2b..61becae78807cf04e4cfc4d4c325fe667baf79e2 100644 (file)
@@ -12,6 +12,7 @@
 #include <ModelAPI_AttributeIntArray.h>
 #include <ModelAPI_AttributeSelection.h>
 #include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_Feature.h>
 #include <ModelAPI_ResultCompSolid.h>
 //--------------------------------------------------------------------------------------
 
@@ -50,6 +51,11 @@ void ModelHighAPI_Selection::fillAttribute(
       return;
     case VT_TypeSubShapeNamePair:
       theAttribute->selectSubShape(myTypeSubShapeNamePair.first, myTypeSubShapeNamePair.second);
+      if(theAttribute->isInvalid()) {
+        FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
+        aFeature->setError(
+          std::string("Error: attribute \"") + theAttribute->id() + std::string("\" is invalid."));
+      }
       return;
   }
 }