diff options
author | Max Kellermann <max@musicpd.org> | 2016-10-27 21:59:17 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-10-27 22:04:41 +0200 |
commit | 6961bd61cac50117872f6cf43585ed594e45abb1 (patch) | |
tree | dee3ec435f875867ac5e7255cde862b07f469dbe /src/SongLoader.cxx | |
parent | 726fc53e624a9b4005194cd57cba035e89b3331d (diff) |
LocateUri: migrate from class Error to C++ exceptions
Diffstat (limited to 'src/SongLoader.cxx')
-rw-r--r-- | src/SongLoader.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/SongLoader.cxx b/src/SongLoader.cxx index a9868f52b..8a5b95920 100644 --- a/src/SongLoader.cxx +++ b/src/SongLoader.cxx @@ -74,9 +74,6 @@ DetachedSong * SongLoader::LoadSong(const LocatedUri &located_uri) const { switch (located_uri.type) { - case LocatedUri::Type::UNKNOWN: - gcc_unreachable(); - case LocatedUri::Type::ABSOLUTE: return new DetachedSong(located_uri.canonical_uri); @@ -91,20 +88,17 @@ SongLoader::LoadSong(const LocatedUri &located_uri) const } DetachedSong * -SongLoader::LoadSong(const char *uri_utf8, Error &error) const +SongLoader::LoadSong(const char *uri_utf8) const { #if !CLANG_CHECK_VERSION(3,6) /* disabled on clang due to -Wtautological-pointer-compare */ assert(uri_utf8 != nullptr); #endif - const auto located_uri = LocateUri(uri_utf8, client, + const auto located_uri = LocateUri(uri_utf8, client #ifdef ENABLE_DATABASE - storage, + , storage #endif - error); - if (located_uri.IsUnknown()) - return nullptr; - + ); return LoadSong(located_uri); } |