mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
LibCore+Everywhere: Return ErrorOr from ConfigFile::sync()
Currently this method always succeeds, but that won't be true once we switch to the Core::Stream API. :^) Some of these places would ideally show an error message to the user, since failure to save a file is significant, but let's not get distracted right now.
This commit is contained in:
parent
b90dc408bd
commit
cd0ffe5460
10 changed files with 39 additions and 24 deletions
|
@ -131,7 +131,11 @@ void ClientConnection::sync_dirty_domains_to_disk()
|
|||
dbgln("Syncing {} dirty domains to disk", dirty_domains.size());
|
||||
for (auto domain : dirty_domains) {
|
||||
auto& config = ensure_domain_config(domain);
|
||||
config.sync();
|
||||
if (auto result = config.sync(); result.is_error()) {
|
||||
dbgln("Failed to write config '{}' to disk: {}", domain, result.error());
|
||||
// Put it back in the list since it's still dirty.
|
||||
m_dirty_domains.set(domain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue