Skip to content

Commit

Permalink
Re #9018. Warn about bad names from validateInputs rather than error.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Feb 25, 2014
1 parent 8763d08 commit 2b25549
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Code/Mantid/Framework/API/src/Algorithm.cpp
Expand Up @@ -532,12 +532,25 @@ namespace Mantid
std::map<std::string, std::string> errors = this->validateInputs();
if (!errors.empty())
{
size_t numErrors = errors.size();
// Log each issue
for (auto it = errors.begin(); it != errors.end(); it++)
g_log.error() << "Invalid value for " << it->first << ": " << it->second << std::endl;
{
if (this->hasProperty(it->first))
g_log.error() << "Invalid value for " << it->first << ": " << it->second << "\n";
else
{
numErrors -= 1; // don't count it as an error
g_log.warning() << "validateInputs() references non-existant property \""
<< it->first << "\"\n";
}
}
// Throw because something was invalid
notificationCenter().postNotification(new ErrorNotification(this,"Some invalid Properties found"));
throw std::runtime_error("Some invalid Properties found");
if (numErrors > 0)
{
m_notificationCenter.postNotification(new ErrorNotification(this,"Some invalid Properties found"));
throw std::runtime_error("Some invalid Properties found");
}
}

// ----- Check for processing groups -------------
Expand Down

0 comments on commit 2b25549

Please sign in to comment.