LocateUri: migrate from class Error to C++ exceptions
This commit is contained in:
@@ -209,12 +209,13 @@ public:
|
||||
unsigned AppendSong(PlayerControl &pc, DetachedSong &&song);
|
||||
|
||||
/**
|
||||
* @return the new song id or 0 on error
|
||||
* Throws #std::runtime_error on error.
|
||||
*
|
||||
* @return the new song id
|
||||
*/
|
||||
unsigned AppendURI(PlayerControl &pc,
|
||||
const SongLoader &loader,
|
||||
const char *uri_utf8,
|
||||
Error &error);
|
||||
const char *uri_utf8);
|
||||
|
||||
protected:
|
||||
void DeleteInternal(PlayerControl &pc,
|
||||
|
@@ -124,13 +124,9 @@ playlist::AppendSong(PlayerControl &pc, DetachedSong &&song)
|
||||
|
||||
unsigned
|
||||
playlist::AppendURI(PlayerControl &pc, const SongLoader &loader,
|
||||
const char *uri,
|
||||
Error &error)
|
||||
const char *uri)
|
||||
{
|
||||
std::unique_ptr<DetachedSong> song(loader.LoadSong(uri, error));
|
||||
if (song == nullptr)
|
||||
return 0;
|
||||
|
||||
std::unique_ptr<DetachedSong> song(loader.LoadSong(uri));
|
||||
return AppendSong(pc, std::move(*song));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user