queue/PlaylistEdit: throw PlaylistError on error

This commit is contained in:
Max Kellermann
2016-02-28 10:51:07 +01:00
parent 50b930f283
commit b6cb9b853a
7 changed files with 49 additions and 84 deletions

View File

@@ -66,7 +66,7 @@ handle_save(Client &client, Request args, gcc_unused Response &r)
}
CommandResult
handle_load(Client &client, Request args, Response &r)
handle_load(Client &client, Request args, gcc_unused Response &r)
{
RangeArg range = args.ParseOptional(1, RangeArg::All());
@@ -74,12 +74,10 @@ handle_load(Client &client, Request args, Response &r)
Error error;
const SongLoader loader(client);
if (!playlist_open_into_queue(args.front(),
range.start, range.end,
client.playlist,
client.player_control, loader, error))
return print_error(r, error);
playlist_open_into_queue(args.front(),
range.start, range.end,
client.playlist,
client.player_control, loader);
return CommandResult::OK;
}