1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 09:31:16 +02:00

Actually, solve this in a lighter-weight way

The templating is very superficial
This commit is contained in:
John Ericson 2022-04-20 17:37:59 +00:00
parent 05ec0beb40
commit f63b0f4540
4 changed files with 40 additions and 46 deletions

View file

@ -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);