fs/FileSystem: RemoveFile() throws exception on error
This commit is contained in:
@@ -321,8 +321,15 @@ spl_delete(const char *name_utf8)
|
||||
const auto path_fs = spl_map_to_fs(name_utf8);
|
||||
assert(!path_fs.IsNull());
|
||||
|
||||
if (!RemoveFile(path_fs))
|
||||
ThrowPlaylistErrno();
|
||||
try {
|
||||
RemoveFile(path_fs);
|
||||
} catch (const std::system_error &e) {
|
||||
if (IsFileNotFound(e))
|
||||
throw PlaylistError(PlaylistResult::NO_SUCH_LIST,
|
||||
"No such playlist");
|
||||
else
|
||||
throw;
|
||||
}
|
||||
|
||||
idle_add(IDLE_STORED_PLAYLIST);
|
||||
}
|
||||
|
Reference in New Issue
Block a user