Skip to content

Commit

Permalink
refs #8958 added a file check
Browse files Browse the repository at this point in the history
The ofstream is now checked to see if it was able to open the file.
  • Loading branch information
keithnbrown committed Feb 12, 2014
1 parent 357a8e4 commit 934c5b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Code/Mantid/Framework/DataHandling/src/SaveANSTO.cpp
Expand Up @@ -62,6 +62,11 @@ namespace Mantid
{
std::string filename = getProperty("Filename");
std::ofstream file(filename.c_str());
if (!file)
{
g_log.error("Unable to create file: " + filename);
throw Exception::FileError("Unable to create file: " , filename);
}
m_ws = getProperty("InputWorkspace");
g_log.information("FILENAME: " + filename);
auto title ='#'+ m_ws->getTitle();
Expand Down

0 comments on commit 934c5b4

Please sign in to comment.