diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-18 17:54:16 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2022-04-19 01:44:11 +0000 |
commit | 75b62e52600a44b42693944b50638bf580a2c86e (patch) | |
tree | db7edec57a29012095e168d004fbb93c4387c470 /src/libstore/sqlite.hh | |
parent | b135de2b5f08aa8b549d69371823235124ef04a1 (diff) |
Avoid `fmt` when constructor already does it
There is a correctnes issue here, but #3724 will fix that. This is just
a cleanup for brevity's sake.
Diffstat (limited to 'src/libstore/sqlite.hh')
-rw-r--r-- | src/libstore/sqlite.hh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/libstore/sqlite.hh b/src/libstore/sqlite.hh index 99f0d56ce..72ec302e1 100644 --- a/src/libstore/sqlite.hh +++ b/src/libstore/sqlite.hh @@ -96,10 +96,20 @@ struct SQLiteTxn }; -MakeError(SQLiteError, Error); -MakeError(SQLiteBusy, SQLiteError); +struct SQLiteError : Error +{ + const char *path; + int errNo, extendedErrNo; + + template<typename... Args> + [[noreturn]] static void throw_(sqlite3 * db, const std::string & fs, const Args & ... args); -[[noreturn]] void throwSQLiteError(sqlite3 * db, const FormatOrString & fs); +protected: + template<typename... Args> + SQLiteError(const char *path, int errNo, int extendedErrNo, const Args & ... args); +}; + +MakeError(SQLiteBusy, SQLiteError); void handleSQLiteBusy(const SQLiteBusy & e); |