expand exception message to include cause of file open failure

This commit is contained in:
Axel Kohlmeyer
2021-04-15 11:57:48 -04:00
parent 6e739c04e4
commit 0870a56093
2 changed files with 4 additions and 2 deletions

View File

@ -46,7 +46,8 @@ TextFileReader::TextFileReader(const std::string &filename, const std::string &f
fp = fopen(filename.c_str(), "r");
if (fp == nullptr) {
throw FileReaderException(fmt::format("cannot open {} file {}", filetype, filename));
throw FileReaderException(fmt::format("cannot open {} file {}: {}",
filetype, filename, utils::getsyserror()));
}
}