diff options
author | Max Kellermann <max@duempel.org> | 2014-12-12 20:49:00 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-12-12 20:49:00 +0100 |
commit | 2ca18a7ee5ede89e95fe9a862262726a1e845268 (patch) | |
tree | 26a6499b398b9c77ed3ef2bb5961bc7d9d66d513 /src/sticker/StickerDatabase.cxx | |
parent | 7dbe5f4640d95737b06063b0162184dc9f1978d0 (diff) | |
download | mpd-2ca18a7ee5ede89e95fe9a862262726a1e845268.tar.gz mpd-2ca18a7ee5ede89e95fe9a862262726a1e845268.tar.xz mpd-2ca18a7ee5ede89e95fe9a862262726a1e845268.zip |
lib/sqlite/Domain: add Domain instance for SQLite
Replaces the sticker_domain for Error::domain.
Diffstat (limited to 'src/sticker/StickerDatabase.cxx')
-rw-r--r-- | src/sticker/StickerDatabase.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/sticker/StickerDatabase.cxx b/src/sticker/StickerDatabase.cxx index be806c036..65d9617f4 100644 --- a/src/sticker/StickerDatabase.cxx +++ b/src/sticker/StickerDatabase.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "StickerDatabase.hxx" +#include "lib/sqlite/Domain.hxx" #include "fs/Path.hxx" #include "Idle.hxx" #include "util/Error.hxx" @@ -91,7 +92,7 @@ sticker_prepare(const char *sql, Error &error) sqlite3_stmt *stmt; int ret = sqlite3_prepare_v2(sticker_db, sql, -1, &stmt, nullptr); if (ret != SQLITE_OK) { - error.Format(sticker_domain, ret, + error.Format(sqlite_domain, ret, "sqlite3_prepare_v2() failed: %s", sqlite3_errmsg(sticker_db)); return nullptr; @@ -112,9 +113,9 @@ sticker_global_init(Path path, Error &error) ret = sqlite3_open(path.c_str(), &sticker_db); if (ret != SQLITE_OK) { const std::string utf8 = path.ToUTF8(); - error.Format(sticker_domain, ret, - "Failed to open sqlite database '%s': %s", - utf8.c_str(), sqlite3_errmsg(sticker_db)); + error.Format(sqlite_domain, ret, + "Failed to open sqlite database '%s': %s", + utf8.c_str(), sqlite3_errmsg(sticker_db)); return false; } @@ -123,7 +124,7 @@ sticker_global_init(Path path, Error &error) ret = sqlite3_exec(sticker_db, sticker_sql_create, nullptr, nullptr, nullptr); if (ret != SQLITE_OK) { - error.Format(sticker_domain, ret, + error.Format(sqlite_domain, ret, "Failed to create sticker table: %s", sqlite3_errmsg(sticker_db)); return false; |