util: Remove fsbridge::get_filesystem_error_message()

The `fsbridge::get_filesystem_error_message()` function exhibits several
drawbacks:

1. It was introduced in https://github.com/bitcoin/bitcoin/pull/14192 to
account for platform-specific variations in
`boost::filesystem::filesystem_error::what()`. Since migrating to
`std::filesystem`, those discrepancies no longer exist.

2. It fails to display UTF-8 paths correctly on Windows.

3. It relies on `std::wstring_convert`, which was deprecated in C++17
and removed in C++26.

This change removes the `fsbridge::get_filesystem_error_message()`
function, thereby resolving all of the above issues.

Additionally, filesystem error messages now use the "Warning" log level.
This commit is contained in:
Hennadii Stepanov
2025-04-30 10:41:34 +01:00
parent a60445cd04
commit 97eaadc3bf
7 changed files with 6 additions and 24 deletions

View File

@@ -170,7 +170,7 @@ void DeleteAuthCookie()
fs::remove(GetAuthCookieFile());
}
} catch (const fs::filesystem_error& e) {
LogPrintf("%s: Unable to remove random auth cookie file: %s\n", __func__, fsbridge::get_filesystem_error_message(e));
LogWarning("Unable to remove random auth cookie file %s: %s\n", fs::PathToString(e.path1()), e.code().message());
}
}