changeset 1958:c746e2d42ac8

extended error codes for SQLite
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 06 Apr 2016 14:41:26 +0200
parents b10a165e0e36
children 45c4387a379c
files Core/SQLite/Connection.cpp Core/SQLite/StatementReference.cpp
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Core/SQLite/Connection.cpp	Wed Apr 06 14:36:56 2016 +0200
+++ b/Core/SQLite/Connection.cpp	Wed Apr 06 14:41:26 2016 +0200
@@ -163,7 +163,8 @@
       if (error == SQLITE_ERROR)
       {
 #if ORTHANC_SQLITE_STANDALONE != 1
-        LOG(ERROR) << "SQLite execute error: " << sqlite3_errmsg(db_);
+        LOG(ERROR) << "SQLite execute error: " << sqlite3_errmsg(db_)
+                   << " (" << sqlite3_extended_errcode(db_) << ")";
 #endif
 
         throw OrthancSQLiteException(ErrorCode_SQLiteExecute);
--- a/Core/SQLite/StatementReference.cpp	Wed Apr 06 14:36:56 2016 +0200
+++ b/Core/SQLite/StatementReference.cpp	Wed Apr 06 14:41:26 2016 +0200
@@ -82,7 +82,8 @@
       if (error != SQLITE_OK)
       {
 #if ORTHANC_SQLITE_STANDALONE != 1
-        LOG(ERROR) << "SQLite: " << sqlite3_errmsg(database);
+        LOG(ERROR) << "SQLite: " << sqlite3_errmsg(database)
+                   << " (" << sqlite3_extended_errcode(database) << ")";
 #endif
 
         throw OrthancSQLiteException(ErrorCode_SQLitePrepareStatement);