diff --git a/src/command/PlaylistCommands.cxx b/src/command/PlaylistCommands.cxx
index 9be27a842..b6746a68e 100644
--- a/src/command/PlaylistCommands.cxx
+++ b/src/command/PlaylistCommands.cxx
@@ -164,11 +164,8 @@ handle_playlistlength(Client &client, Request args, Response &r)
 #endif
 					   );
 
-	if (playlist_file_length(r, client.GetPartition(), SongLoader(client),
-				name))
-		return CommandResult::OK;
-
-	throw PlaylistError::NoSuchList();
+	playlist_file_length(r, client.GetPartition(), SongLoader(client), name);
+	return CommandResult::OK;
 }
 
 CommandResult
diff --git a/src/playlist/Length.cxx b/src/playlist/Length.cxx
index 56c03cc6f..146e675fa 100644
--- a/src/playlist/Length.cxx
+++ b/src/playlist/Length.cxx
@@ -14,6 +14,7 @@
 #include "thread/Mutex.hxx"
 #include "Partition.hxx"
 #include "Instance.hxx"
+#include "PlaylistError.hxx"
 
 #include <fmt/format.h>
 
@@ -45,10 +46,10 @@ playlist_provider_length(Response &r,
 	r.Fmt(FMT_STRING("playtime: {}\n"), playtime.RoundS());
 }
 
-bool
+void
 playlist_file_length(Response &r, Partition &partition,
-		    const SongLoader &loader,
-		    const LocatedUri &uri)
+		     const SongLoader &loader,
+		     const LocatedUri &uri)
 {
 	Mutex mutex;
 
@@ -62,8 +63,7 @@ playlist_file_length(Response &r, Partition &partition,
 #endif
 					  mutex);
 	if (playlist == nullptr)
-		return false;
+		throw PlaylistError::NoSuchList();
 
 	playlist_provider_length(r, loader, uri.canonical_uri, *playlist);
-	return true;
 }
diff --git a/src/playlist/Length.hxx b/src/playlist/Length.hxx
index 053b784c4..2245139d6 100644
--- a/src/playlist/Length.hxx
+++ b/src/playlist/Length.hxx
@@ -1,8 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // Copyright The Music Player Daemon Project
 
-#ifndef MPD_PLAYLIST__LENGTH_HXX
-#define MPD_PLAYLIST__LENGTH_HXX
+#pragma once
 
 #include "client/Response.hxx"
 
@@ -13,12 +12,12 @@ struct Partition;
  * Count the number of songs and their total playtime (seconds) in the
  * playlist.
  *
+ * Throws on error.
+ *
  * @param uri the URI of the playlist file in UTF-8 encoding
  * @return true on success, false if the playlist does not exist
  */
-bool
+void
 playlist_file_length(Response &r, Partition &partition,
-		    const SongLoader &loader,
-		    const LocatedUri &uri);
-
-#endif
+		     const SongLoader &loader,
+		     const LocatedUri &uri);