about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-04-16T09·37+0200
committerEelco Dolstra <edolstra@gmail.com>2018-05-30T11·25+0200
commit3cab639e21fb39d6e0530910cf94b5bf60dbf5b3 (patch)
tree93fdb29661d9791aee3b1fa470f27cd6f04ccef6
parentbd56b5fe3f5374e845fd58f8ecd9e111f2e5104c (diff)
Use extended SQLite error codes
-rw-r--r--src/libstore/sqlite.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc
index 42d40e71d8be..a061d64f36d8 100644
--- a/src/libstore/sqlite.cc
+++ b/src/libstore/sqlite.cc
@@ -10,6 +10,7 @@ namespace nix {
 [[noreturn]] void throwSQLiteError(sqlite3 * db, const FormatOrString & fs)
 {
     int err = sqlite3_errcode(db);
+    int exterr = sqlite3_extended_errcode(db);
 
     auto path = sqlite3_db_filename(db, nullptr);
     if (!path) path = "(in-memory)";
@@ -21,7 +22,7 @@ namespace nix {
             : fmt("SQLite database '%s' is busy", path));
     }
     else
-        throw SQLiteError("%s: %s (in '%s')", fs.s, sqlite3_errstr(err), path);
+        throw SQLiteError("%s: %s (in '%s')", fs.s, sqlite3_errstr(exterr), path);
 }
 
 SQLite::SQLite(const Path & path)