fs/io/FileOutputStream: use C++ exceptions in Commit()

This commit is contained in:
Max Kellermann
2015-12-16 00:24:41 +01:00
parent 24b2198668
commit 7eae3bc8c5
8 changed files with 61 additions and 44 deletions

View File

@@ -92,10 +92,12 @@ StateFile::Write()
try {
Error error;
FileOutputStream fos(path);
if (!Write(fos, error) || !fos.Commit(error)) {
if (!Write(fos, error)) {
LogError(error);
return;
}
fos.Commit();
} catch (const std::exception &e) {
LogError(e);
}