diff --git a/Utilities/File.cpp b/Utilities/File.cpp index c02e04f94e..8abd8fb54d 100644 --- a/Utilities/File.cpp +++ b/Utilities/File.cpp @@ -129,8 +129,7 @@ static fs::error to_error(DWORD e) case ERROR_DIR_NOT_EMPTY: return fs::error::notempty; case ERROR_NOT_READY: return fs::error::noent; case ERROR_FILENAME_EXCED_RANGE: return fs::error::toolong; - //case ERROR_INVALID_PARAMETER: return fs::error::inval; - default: fmt::throw_exception("Unknown Win32 error: %u.", e); + default: return fs::error::unknown; } } @@ -171,7 +170,7 @@ static fs::error to_error(int e) case ENOTEMPTY: return fs::error::notempty; case EROFS: return fs::error::readonly; case EISDIR: return fs::error::isdir; - default: fmt::throw_exception("Unknown system error: %d.", e); + default: return fs::error::unknown; } } @@ -1823,6 +1822,7 @@ void fmt_class_string::format(std::string& out, u64 arg) case fs::error::readonly: return "Read only"; case fs::error::isdir: return "Is a directory"; case fs::error::toolong: return "Path too long"; + case fs::error::unknown: return "Unknown system error"; } return unknown; diff --git a/Utilities/File.h b/Utilities/File.h index 5bcf27b96d..36776b6b2e 100644 --- a/Utilities/File.h +++ b/Utilities/File.h @@ -516,6 +516,7 @@ namespace fs readonly, isdir, toolong, + unknown }; // Error code returned