diff options
author | Max Kellermann <max@duempel.org> | 2015-12-16 10:24:43 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-12-16 10:24:43 +0100 |
commit | e4a06da14e1184eacd00834aaf05c5457703a7eb (patch) | |
tree | 7d4d168bfd8475e9113b2d9d2e4b8b74c606f092 /src/StateFile.cxx | |
parent | 36d6ead65cf507948744ee5d8615c8ef20e42f9d (diff) |
fs/io/OutputStream: use C++ exceptions in Write()
Diffstat (limited to 'src/StateFile.cxx')
-rw-r--r-- | src/StateFile.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/StateFile.cxx b/src/StateFile.cxx index 7c92ae0ee..fb031d04b 100644 --- a/src/StateFile.cxx +++ b/src/StateFile.cxx @@ -75,12 +75,12 @@ StateFile::Write(BufferedOutputStream &os) playlist_state_save(os, partition.playlist, partition.pc); } -inline bool -StateFile::Write(OutputStream &os, Error &error) +inline void +StateFile::Write(OutputStream &os) { BufferedOutputStream bos(os); Write(bos); - return bos.Flush(error); + bos.Flush(); } void @@ -90,13 +90,8 @@ StateFile::Write() "Saving state file %s", path_utf8.c_str()); try { - Error error; FileOutputStream fos(path); - if (!Write(fos, error)) { - LogError(error); - return; - } - + Write(fos); fos.Commit(); } catch (const std::exception &e) { LogError(e); |