From 65386f52f03c21a8017eb01fe39af6b411cfd428 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 28 Feb 2016 11:47:03 +0100 Subject: [PATCH] db/proxy: throw DatabaseError on error --- src/db/plugins/ProxyDatabasePlugin.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx index 557ff5281..6bd7540ec 100644 --- a/src/db/plugins/ProxyDatabasePlugin.cxx +++ b/src/db/plugins/ProxyDatabasePlugin.cxx @@ -517,11 +517,9 @@ ProxyDatabase::GetSong(const char *uri, Error &error) const return nullptr; } - if (song == nullptr) { - error.Format(db_domain, (int)DatabaseErrorCode::NOT_FOUND, - "No such song: %s", uri); - return nullptr; - } + if (song == nullptr) + throw DatabaseError(DatabaseErrorCode::NOT_FOUND, + "No such song"); return new AllocatedProxySong(song); }