mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-23 14:10:15 +01:00
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:
@@ -722,7 +722,7 @@ bool BerkeleyRODatabase::Backup(const std::string& dest) const
|
||||
LogPrintf("copied %s to %s\n", fs::PathToString(m_filepath), fs::PathToString(dst));
|
||||
return true;
|
||||
} catch (const fs::filesystem_error& e) {
|
||||
LogPrintf("error copying %s to %s - %s\n", fs::PathToString(m_filepath), fs::PathToString(dst), fsbridge::get_filesystem_error_message(e));
|
||||
LogWarning("error copying %s to %s - %s\n", fs::PathToString(m_filepath), fs::PathToString(dst), e.code().message());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user