Skip to content

Commit

Permalink
Changed the type of exception thrown for spearators and comments
Browse files Browse the repository at this point in the history
Save and Laod now both throw std::invalid_argument rather than std::runtime_error if validation on separator and comment characters fail.

Refs #7732
  • Loading branch information
keithnbrown committed Oct 22, 2013
1 parent 3bfa2fd commit d86a608
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadAscii2.cpp
Expand Up @@ -527,14 +527,14 @@ namespace Mantid

if (!boost::regex_match(m_columnSep.begin(), m_columnSep.end(), test))
{
throw std::runtime_error("Separators cannot contain numeric characters");
throw std::invalid_argument("Separators cannot contain numeric characters");
}

m_comment = getProperty("CommentIndicator");

if (!boost::regex_match(m_comment.begin(), m_comment.end(), test))
{
throw std::runtime_error("Comment markers cannot contain numeric characters");
throw std::invalid_argument("Comment markers cannot contain numeric characters");
}

// Process the header information.
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/SaveAscii2.cpp
Expand Up @@ -136,14 +136,14 @@ namespace Mantid

if (!boost::regex_match(m_sep.begin(), m_sep.end(), test))
{
throw std::runtime_error("Separators cannot contain numeric characters");
throw std::invalid_argument("Separators cannot contain numeric characters");
}

std::string comment = getPropertyValue("CommentIndicator");

if (!boost::regex_match(comment.begin(), comment.end(), test))
{
throw std::runtime_error("Comment markers cannot contain numeric characters");
throw std::invalid_argument("Comment markers cannot contain numeric characters");
}

// Create an spectra index list for output
Expand Down

0 comments on commit d86a608

Please sign in to comment.