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:
parent
05ec0beb40
commit
f63b0f4540
4 changed files with 40 additions and 46 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue