From aca081557a273b2ccbce2602745ac35ff3f1eac3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 5 Sep 2016 20:37:24 +0200 Subject: [PATCH] queue/PlaylistControl: use PlaylistError::NotPlaying() --- src/queue/PlaylistControl.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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());