Skip to content

Commit

Permalink
Simplfy error message from Load when files are not found. Refs #6445
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed May 21, 2013
1 parent 9d34d73 commit 74ec494
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Code/Mantid/Framework/API/src/MultipleFileProperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ namespace API
catch(const std::runtime_error & re)
{
g_log.debug("MultiFile loading has failed. Acting as standard FileProperty.");

const std::string error = setValueAsSingleFile(propValue);

if( error.empty() )
return "";

// If we failed for whatever reason, catch the message and return it.
return "Unable to parse runs: \"" + std::string(re.what()) + "\". ";
return re.what();
}
}

Expand Down Expand Up @@ -265,7 +265,7 @@ namespace API
}
catch(const std::runtime_error & re)
{
errorMsg << "Unable to parse run(s): \"" << re.what() << "\", so will treat as a single file. ";
errorMsg << "Unable to parse run(s): \"" << re.what();
}

std::vector<std::vector<std::string> > f = m_parser.fileNames();
Expand Down Expand Up @@ -371,8 +371,7 @@ namespace API
// If an error was returned then pass it along.
if(!error.empty())
{
errorMsg << "Unable to find file matching the string \"" + *unresolvedFileName + "\": \"" + error + "\".";
throw std::runtime_error(errorMsg.str());
throw std::runtime_error(error);
}

fullyResolvedFile = slaveFileProp();
Expand Down

0 comments on commit 74ec494

Please sign in to comment.