Salome HOME
Update SketchPlugin_Projection feature (issue #1459)
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_Validators.cpp
index d13b2c478248d939d940492b18b45ae6a1f08dc1..e0579464007a69089e5e9578d58dfcb40bb747bb 100644 (file)
@@ -41,17 +41,23 @@ bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute,
                                              const std::list<std::string>& theArguments,
                                              std::string& theError) const
 {
-  if (!theAttribute->isInitialized())
+  if (!theAttribute->isInitialized()) {
+    theError = "Is not initialized.";
     return false;
+  }
 
   const AttributeStringPtr aStrAttr =
       std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
-  if (!aStrAttr)
+  if (!aStrAttr) {
+    theError = "Is not a string attribute.";
     return false;
+  }
 
   std::string aFileName = aStrAttr->value();
-  if (aFileName.empty())
+  if (aFileName.empty()) {
+    theError = "File name is empty.";
     return false;
+  }
 
   std::list<std::string> aFormats;
   ExchangePlugin_FormatValidator::parseFormats(theArguments, aFormats);
@@ -67,5 +73,6 @@ bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute,
       }
     }
   }
+  theError = "File name does not end with any available format.";
   return false;
 }