Added missing error message when input file does not exist.
This commit is contained in:
parent
0930e062c4
commit
cdcee897ec
@ -6,6 +6,10 @@ Features:
|
|||||||
|
|
||||||
* unique IDs for all variables (user-defined variables are renamed)
|
* 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)
|
## 0.1.5 (2017-05-04)
|
||||||
|
|
||||||
Bug Fixes:
|
Bug Fixes:
|
||||||
|
@ -29,9 +29,9 @@ class Exception: public std::exception
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: set plain message as well
|
|
||||||
explicit Exception(const std::string &message)
|
explicit Exception(const std::string &message)
|
||||||
: m_message{message}
|
: m_message{message},
|
||||||
|
m_plainMessage{message}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,9 @@ void translate(const std::vector<std::string> &fileNames, Context &context)
|
|||||||
{
|
{
|
||||||
std::ifstream file(fileName, std::ios::in);
|
std::ifstream file(fileName, std::ios::in);
|
||||||
|
|
||||||
|
if (!file.is_open())
|
||||||
|
throw LogicException("could not read file “" + fileName + "”");
|
||||||
|
|
||||||
translate(fileName.c_str(), file, context);
|
translate(fileName.c_str(), file, context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user