diff options
author | Philipp Kerling <pkerling@casix.org> | 2019-01-11 12:42:06 +0100 |
---|---|---|
committer | Philipp Kerling <pkerling@casix.org> | 2019-02-06 22:11:17 +0100 |
commit | 7bb430522d7a40f38d76a698c121d3f2fa03a125 (patch) | |
tree | 7d71f1164c583eb07d17de261708f180ac3a52aa | |
parent | 2e54c809387fc0ced6d26602f42a14b0797552dc (diff) |
[sqlite] Include sqlite3_errmsg() result in error messages
Improves debugging by including information about the actual SQL error
in log messages (mostly relevant for sqlite3_prepare_v2 and
sqlite3_finalize, but doesn't hurt to just print it always)
-rw-r--r-- | xbmc/dbwrappers/sqlitedataset.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xbmc/dbwrappers/sqlitedataset.cpp b/xbmc/dbwrappers/sqlitedataset.cpp index 4643370de8..5ad10c8813 100644 --- a/xbmc/dbwrappers/sqlitedataset.cpp +++ b/xbmc/dbwrappers/sqlitedataset.cpp @@ -271,6 +271,8 @@ int SqliteDatabase::setErr(int err_code, const char * qry) { } else { ss << "Undefined SQLite error " << err_code; } + if (conn) + ss << " (" << sqlite3_errmsg(conn) << ")"; ss << "\nQuery: " << qry; error = ss.str(); return err_code; |