playlist/Song: catch SongLoader exceptions
Fixes aborted "load" commands due to SongLoader failure.
This commit is contained in:
@@ -27,6 +27,8 @@
|
|||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
#include "DetachedSong.hxx"
|
#include "DetachedSong.hxx"
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -44,7 +46,14 @@ merge_song_metadata(DetachedSong &add, const DetachedSong &base)
|
|||||||
static bool
|
static bool
|
||||||
playlist_check_load_song(DetachedSong &song, const SongLoader &loader)
|
playlist_check_load_song(DetachedSong &song, const SongLoader &loader)
|
||||||
{
|
{
|
||||||
DetachedSong *tmp = loader.LoadSong(song.GetURI(), IgnoreError());
|
DetachedSong *tmp;
|
||||||
|
|
||||||
|
try {
|
||||||
|
tmp = loader.LoadSong(song.GetURI(), IgnoreError());
|
||||||
|
} catch (const std::runtime_error &) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (tmp == nullptr)
|
if (tmp == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user