Salome HOME
Issue #1005: To improve user-friendship of error-messages for features and attributes
[modules/shaper.git] / src / ModelAPI / ModelAPI_Feature.cpp
index b3b60c7926d9207da78aa997b1e827c4fc826284..73e0428d257012d02c765a953b48970cf390f769 100644 (file)
 #include <ModelAPI_Document.h>
 #include <ModelAPI_Session.h>
 #include <Events_Loop.h>
+#include <Config_Translator.h>
+
+void ModelAPI_Feature::setError(const std::string& theError,
+                                bool isSend,
+                                bool isTranslate)
+{
+  std::string anError = isTranslate ? Config_Translator::translate(getKind(), theError)
+                                    : theError;
+  data()->setError(anError, isSend);
+}
 
 const std::list<std::shared_ptr<ModelAPI_Result> >& ModelAPI_Feature::results()
 {