diff --git a/libs/io/source/file_stream.cpp b/libs/io/source/file_stream.cpp index 50c809cb..56b3eb0e 100644 --- a/libs/io/source/file_stream.cpp +++ b/libs/io/source/file_stream.cpp @@ -8,7 +8,7 @@ namespace psemek::io static void throw_fopen [[noreturn]] (std::filesystem::path const & path) { - throw std::runtime_error("Failed to open " + path.string() + ": " + std::string(std::strerror(errno))); + throw std::system_error(std::error_code{errno, std::system_category()}, "Failed to open " + path.string()); } static FILE * safe_fopen(std::filesystem::path const & path, const char * mode)