Fix file error reporting.

Not sure why exceptions don't have that info… 🤷
This commit is contained in:
tastytea 2021-05-31 22:19:55 +02:00
parent 80e2e9d05d
commit 1fee4f5afd
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 3 additions and 3 deletions

View File

@ -32,6 +32,7 @@
#include <cmath> #include <cmath>
#include <cstdint> #include <cstdint>
#include <cstdlib> #include <cstdlib>
#include <cstring>
#include <exception> #include <exception>
#include <fstream> #include <fstream>
#include <future> #include <future>
@ -158,12 +159,11 @@ int main(int argc, char *argv[])
} }
catch (const std::ifstream::failure &e) catch (const std::ifstream::failure &e)
{ {
// std::ifstream seems to always return a generic error?
LOG(lg, log::sev::error) LOG(lg, log::sev::error)
<< translate("Probably permission denied.") << " (" << std::strerror(errno)
<< e.what() << ')'
<< format(translate(" (while opening {0:s})").str(), << format(translate(" (while opening {0:s})").str(),
filepath); filepath);
return EXIT_FAILURE;
} }
} }