mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
Print last system error on fs::error::unknown
This commit is contained in:
parent
097d1d91bb
commit
fa892692c5
1 changed files with 11 additions and 0 deletions
|
@ -2639,6 +2639,17 @@ void fmt_class_string<fs::seek_mode>::format(std::string& out, u64 arg)
|
|||
template<>
|
||||
void fmt_class_string<fs::error>::format(std::string& out, u64 arg)
|
||||
{
|
||||
if (arg == static_cast<u64>(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)
|
||||
|
|
Loading…
Add table
Reference in a new issue