aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/sqlite.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-04-20 17:37:59 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-04-20 17:37:59 +0000
commitf63b0f4540b61d8cdac7a3c52ca6e190f7c1b8cf (patch)
tree4a2d64676c390c1a37bc94e4119892801d4ef0d4 /src/libstore/sqlite.hh
parent05ec0beb40f5e4e162903570b68837b34811a02d (diff)
Actually, solve this in a lighter-weight way
The templating is very superficial
Diffstat (limited to 'src/libstore/sqlite.hh')
-rw-r--r--src/libstore/sqlite.hh14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libstore/sqlite.hh b/src/libstore/sqlite.hh
index 72ec302e1..3a4ad8633 100644
--- a/src/libstore/sqlite.hh
+++ b/src/libstore/sqlite.hh
@@ -102,11 +102,21 @@ struct SQLiteError : Error
int errNo, extendedErrNo;
template<typename... Args>
- [[noreturn]] static void throw_(sqlite3 * db, const std::string & fs, const Args & ... args);
+ [[noreturn]] static void throw_(sqlite3 * db, const std::string & fs, const Args & ... args) {
+ throw_(db, hintfmt(fs, args...));
+ }
protected:
+
+ SQLiteError(const char *path, int errNo, int extendedErrNo, hintformat && hf);
+
template<typename... Args>
- SQLiteError(const char *path, int errNo, int extendedErrNo, const Args & ... args);
+ SQLiteError(const char *path, int errNo, int extendedErrNo, const std::string & fs, const Args & ... args)
+ : SQLiteError(path, errNo, extendedErrNo, hintfmt(fs, args...))
+ { }
+
+ [[noreturn]] static void throw_(sqlite3 * db, hintformat && hf);
+
};
MakeError(SQLiteBusy, SQLiteError);