diff --git a/src/queue/PlaylistControl.cxx b/src/queue/PlaylistControl.cxx index 8db0cda7d..84e0f82cf 100644 --- a/src/queue/PlaylistControl.cxx +++ b/src/queue/PlaylistControl.cxx @@ -121,11 +121,8 @@ playlist::PlayId(PlayerControl &pc, int id, Error &error) bool playlist::PlayNext(PlayerControl &pc, Error &error) { - if (!playing) { - error.Set(playlist_domain, int(PlaylistResult::NOT_PLAYING), - "Not playing"); - return false; - } + if (!playing) + throw PlaylistError::NotPlaying(); assert(!queue.IsEmpty()); assert(queue.IsValidOrder(current)); @@ -173,11 +170,8 @@ playlist::PlayNext(PlayerControl &pc, Error &error) bool playlist::PlayPrevious(PlayerControl &pc, Error &error) { - if (!playing) { - error.Set(playlist_domain, int(PlaylistResult::NOT_PLAYING), - "Not playing"); - return false; - } + if (!playing) + throw PlaylistError::NotPlaying(); assert(!queue.IsEmpty());