From c8be9662bb2b33b032e6eebf9af3c5dc704d83fd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 15 May 2024 20:53:40 +0200 Subject: [PATCH] playlist/Print: add missing exception handler This went missing in commit f53cd44c7a557cde5b16928728ceea10d4431c0a --- src/playlist/Print.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/playlist/Print.cxx b/src/playlist/Print.cxx index 84b6a69d4..fe42a10f3 100644 --- a/src/playlist/Print.cxx +++ b/src/playlist/Print.cxx @@ -9,6 +9,7 @@ #include "SongEnumerator.hxx" #include "SongPrint.hxx" #include "song/DetachedSong.hxx" +#include "input/Error.hxx" #include "fs/Traits.hxx" #include "thread/Mutex.hxx" #include "Partition.hxx" @@ -56,7 +57,7 @@ playlist_file_print(Response &r, Partition &partition, unsigned start_index, unsigned end_index, bool detail) -{ +try { Mutex mutex; #ifndef ENABLE_DATABASE @@ -73,4 +74,9 @@ playlist_file_print(Response &r, Partition &partition, playlist_provider_print(r, loader, uri.canonical_uri, *playlist, start_index, end_index, detail); +} catch (...) { + if (IsFileNotFound(std::current_exception())) + throw PlaylistError::NoSuchList(); + + throw; }