db/proxy: throw DatabaseError on error
This commit is contained in:
parent
5b8dce7456
commit
65386f52f0
@ -517,11 +517,9 @@ ProxyDatabase::GetSong(const char *uri, Error &error) const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (song == nullptr) {
|
if (song == nullptr)
|
||||||
error.Format(db_domain, (int)DatabaseErrorCode::NOT_FOUND,
|
throw DatabaseError(DatabaseErrorCode::NOT_FOUND,
|
||||||
"No such song: %s", uri);
|
"No such song");
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new AllocatedProxySong(song);
|
return new AllocatedProxySong(song);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user