summaryrefslogtreecommitdiff
path: root/src/lib/exceptions.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-01-19 00:21:11 +0100
committerCarl Hetherington <cth@carlh.net>2025-01-22 14:34:25 +0100
commit16b3f6c6245acf9689349dbd2af7d4411f861767 (patch)
tree14bedff2389bf48c643e1a7d34c82d8265251801 /src/lib/exceptions.cc
parent9964a038c1a1ed86510439a33b7022807af31d8d (diff)
Move sqlite database open/close to a new SQLiteDatabase.
Diffstat (limited to 'src/lib/exceptions.cc')
-rw-r--r--src/lib/exceptions.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/exceptions.cc b/src/lib/exceptions.cc
index 27496dcdc..5f0fe935a 100644
--- a/src/lib/exceptions.cc
+++ b/src/lib/exceptions.cc
@@ -19,8 +19,9 @@
*/
-#include "exceptions.h"
#include "compose.hpp"
+#include "exceptions.h"
+#include "sqlite_database.h"
#include "i18n.h"
@@ -180,3 +181,13 @@ DiskFullError::DiskFullError(boost::filesystem::path writing)
}
+
+boost::filesystem::path
+SQLError::get_filename(SQLiteDatabase& db)
+{
+ if (auto filename = sqlite3_db_filename(db.db(), "main")) {
+ return filename;
+ }
+
+ return {};
+}