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