Added missing error message when input file does not exist.

This commit is contained in:
Patrick Lühne 2017-06-01 03:29:09 +02:00
parent 0930e062c4
commit cdcee897ec
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
3 changed files with 9 additions and 2 deletions

View File

@ -6,6 +6,10 @@ Features:
* unique IDs for all variables (user-defined variables are renamed)
Bug Fixes:
* adds missing error message when attempting to read inaccessible file
## 0.1.5 (2017-05-04)
Bug Fixes:

View File

@ -29,9 +29,9 @@ class Exception: public std::exception
{
}
// TODO: set plain message as well
explicit Exception(const std::string &message)
: m_message{message}
: m_message{message},
m_plainMessage{message}
{
}

View File

@ -27,6 +27,9 @@ void translate(const std::vector<std::string> &fileNames, Context &context)
{
std::ifstream file(fileName, std::ios::in);
if (!file.is_open())
throw LogicException("could not read file “" + fileName + "");
translate(fileName.c_str(), file, context);
}
}