lib/sqlite, sticker: migrate from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-10-27 07:50:08 +02:00
parent 8d41e9658f
commit 10e32454ef
11 changed files with 255 additions and 306 deletions

View File

@@ -22,7 +22,6 @@
#include "Partition.hxx"
#include "Idle.hxx"
#include "Stats.hxx"
#include "util/Error.hxx"
#ifdef ENABLE_DATABASE
#include "db/DatabaseError.hxx"
@@ -33,6 +32,8 @@
#endif
#endif
#include <stdexcept>
#ifdef ENABLE_DATABASE
const Database &
@@ -63,8 +64,12 @@ Instance::OnDatabaseSongRemoved(const char *uri)
#ifdef ENABLE_SQLITE
/* if the song has a sticker, remove it */
if (sticker_enabled())
sticker_song_delete(uri, IgnoreError());
if (sticker_enabled()) {
try {
sticker_song_delete(uri);
} catch (const std::runtime_error &) {
}
}
#endif
partition->StaleSong(uri);