playlist/Mapper: postpone the stored playlist error

Fixes another regression by commit
f53cd44c7a - an exception thrown by
playlist_open_in_playlist_dir() would skip over
playlist_open_in_storage().
This commit is contained in:
Max Kellermann 2024-05-15 21:07:41 +02:00
parent c8be9662bb
commit 9f174c56ce
1 changed files with 14 additions and 3 deletions

View File

@ -56,10 +56,18 @@ playlist_mapper_open(const char *uri,
#endif
Mutex &mutex)
{
std::exception_ptr spl_error;
if (spl_valid_name(uri)) {
auto playlist = playlist_open_in_playlist_dir(uri, mutex);
if (playlist != nullptr)
return playlist;
try {
auto playlist = playlist_open_in_playlist_dir(uri, mutex);
if (playlist != nullptr)
return playlist;
} catch (...) {
/* postpone this exception, try playlist in
music_directory first */
spl_error = std::current_exception();
}
}
#ifdef ENABLE_DATABASE
@ -70,5 +78,8 @@ playlist_mapper_open(const char *uri,
}
#endif
if (spl_error)
std::rethrow_exception(spl_error);
return nullptr;
}