PlaylistPrint: throw PlaylistError on error
This commit is contained in:
@@ -46,7 +46,7 @@ playlist_print_uris(Response &r, Partition &partition,
|
||||
queue_print_uris(r, partition, queue, 0, queue.GetLength());
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
playlist_print_info(Response &r, Partition &partition,
|
||||
const playlist &playlist,
|
||||
unsigned start, unsigned end)
|
||||
@@ -59,13 +59,12 @@ playlist_print_info(Response &r, Partition &partition,
|
||||
|
||||
if (start > end)
|
||||
/* an invalid "start" offset is fatal */
|
||||
return false;
|
||||
throw PlaylistError::BadRange();
|
||||
|
||||
queue_print_info(r, partition, queue, start, end);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
playlist_print_id(Response &r, Partition &partition, const playlist &playlist,
|
||||
unsigned id)
|
||||
{
|
||||
@@ -74,10 +73,10 @@ playlist_print_id(Response &r, Partition &partition, const playlist &playlist,
|
||||
position = playlist.queue.IdToPosition(id);
|
||||
if (position < 0)
|
||||
/* no such song */
|
||||
return false;
|
||||
throw PlaylistError::NoSuchSong();
|
||||
|
||||
return playlist_print_info(r, partition,
|
||||
playlist, position, position + 1);
|
||||
playlist_print_info(r, partition,
|
||||
playlist, position, position + 1);
|
||||
}
|
||||
|
||||
bool
|
||||
|
Reference in New Issue
Block a user