From 1fee4f5afd96ba186c32050dec88963851131f79 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 31 May 2021 22:19:55 +0200 Subject: [PATCH] Fix file error reporting. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not sure why exceptions don't have that info… 🤷 --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8ce569a..71929f0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -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; } }