playlist/Print: throw PlaylistError::NoSuchList instead of returning false

This commit is contained in:
Max Kellermann
2024-05-15 20:17:54 +02:00
parent a5456a89dc
commit 9303764a83
3 changed files with 15 additions and 21 deletions

View File

@@ -128,11 +128,9 @@ handle_listplaylist(Client &client, Request args, Response &r)
RangeArg range = args.ParseOptional(1, RangeArg::All());
if (playlist_file_print(r, client.GetPartition(), SongLoader(client),
name, range.start, range.end, false))
return CommandResult::OK;
throw PlaylistError::NoSuchList();
playlist_file_print(r, client.GetPartition(), SongLoader(client),
name, range.start, range.end, false);
return CommandResult::OK;
}
CommandResult
@@ -147,11 +145,9 @@ handle_listplaylistinfo(Client &client, Request args, Response &r)
RangeArg range = args.ParseOptional(1, RangeArg::All());
if (playlist_file_print(r, client.GetPartition(), SongLoader(client),
name, range.start, range.end, true))
return CommandResult::OK;
throw PlaylistError::NoSuchList();
playlist_file_print(r, client.GetPartition(), SongLoader(client),
name, range.start, range.end, true);
return CommandResult::OK;
}
CommandResult