#include <ModelAPI_Result.h>
#include <Model_Data.h>
+#include <Config_Translator.h>
+
#include <Events_InfoMessage.h>
void Model_ValidatorsFactory::registerValidator(const std::string& theID,
if (!aFValidator->isValid(theFeature, anArguments, anError)) {
if (anError.empty())
anError = "Unknown error.";
- anError = aValidatorID + ": " + anError.messageString();
- theFeature->setError(anError.messageString(), false);
+ if (anError.context().empty()) {
+ anError.setContext(theFeature->getKind() + ":" + aValidatorID);
+ }
+ theFeature->setError(Config_Translator::translate(anError), false, false);
theFeature->data()->execState(ModelAPI_StateInvalidArgument);
return false;
}
if (!validate(anAttribute, aValidatorID, anError)) {
if (anError.empty())
anError = "Unknown error.";
- anError = anAttributeID + " - " + aValidatorID + ": " + anError.messageString();
- theFeature->setError(anError.messageString(), false);
+ if (anError.context().empty()) {
+ anError.setContext(theFeature->getKind() + ":" + anAttributeID + ":" + aValidatorID);
+ }
+ theFeature->setError(anError.messageString(), false, false);
theFeature->data()->execState(ModelAPI_StateInvalidArgument);
return false;
}