diff --git a/Utilities/File.cpp b/Utilities/File.cpp index 89d53f9407..7426529e26 100644 --- a/Utilities/File.cpp +++ b/Utilities/File.cpp @@ -2639,6 +2639,17 @@ void fmt_class_string::format(std::string& out, u64 arg) template<> void fmt_class_string::format(std::string& out, u64 arg) { + if (arg == static_cast(fs::error::unknown)) + { + // Note: may not be the correct error code because it only prints the last +#ifdef _WIN32 + fmt::append(out, "Unknown error [errno=%d]", GetLastError()); +#else + fmt::append(out, "Unknown error [errno=%d]", errno); +#endif + return; + } + format_enum(out, arg, [](auto arg) { switch (arg)