fs/io/FileOutputStream: use C++ exceptions in constructor

This commit is contained in:
Max Kellermann
2015-12-15 22:26:26 +01:00
parent d29be0f460
commit 24b2198668
9 changed files with 64 additions and 72 deletions

View File

@@ -232,11 +232,7 @@ SavePlaylistFile(const PlaylistFileContents &contents, const char *utf8path,
if (path_fs.IsNull())
return false;
FileOutputStream fos(path_fs, error);
if (!fos.IsDefined()) {
TranslatePlaylistError(error);
return false;
}
FileOutputStream fos(path_fs);
BufferedOutputStream bos(fos);
@@ -403,11 +399,7 @@ spl_append_song(const char *utf8path, const DetachedSong &song, Error &error)
if (path_fs.IsNull())
return false;
AppendFileOutputStream fos(path_fs, error);
if (!fos.IsDefined()) {
TranslatePlaylistError(error);
return false;
}
AppendFileOutputStream fos(path_fs);
if (fos.Tell() / (MPD_PATH_MAX + 1) >= playlist_max_length) {
error.Set(playlist_domain, int(PlaylistResult::TOO_LARGE),