summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-08-21 15:35:00 -0700
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-08-24 09:42:36 -0700
commitc26ded5e1f25afb80756fd64f0df93fb731f3008 (patch)
treed0227e709bf0a34802c43b26735815e985c34a4f
parent880d37cda567114de29d076a3b7648dad830140a (diff)
downloadqtlocation-mapboxgl-c26ded5e1f25afb80756fd64f0df93fb731f3008.tar.gz
Use QSqlError::databaseText for reporting errors from SQLite wrapper to match SQLite3 error messages
-rw-r--r--platform/qt/src/sqlite3.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/qt/src/sqlite3.cpp b/platform/qt/src/sqlite3.cpp
index 96cee5fff8..d27ebf354d 100644
--- a/platform/qt/src/sqlite3.cpp
+++ b/platform/qt/src/sqlite3.cpp
@@ -27,9 +27,9 @@ void checkQueryError(const QSqlQuery& query) {
QSqlError lastError = query.lastError();
if (lastError.type() != QSqlError::NoError) {
#if QT_VERSION >= 0x050300
- throw Exception { lastError.nativeErrorCode().toInt(), lastError.text().toStdString() };
+ throw Exception { lastError.nativeErrorCode().toInt(), lastError.databaseText().toStdString() };
#else
- throw Exception { lastError.number(), lastError.text().toStdString() };
+ throw Exception { lastError.number(), lastError.databaseText().toStdString() };
#endif
}
}
@@ -38,9 +38,9 @@ void checkDatabaseError(const QSqlDatabase &db) {
QSqlError lastError = db.lastError();
if (lastError.type() != QSqlError::NoError) {
#if QT_VERSION >= 0x050300
- throw Exception { lastError.nativeErrorCode().toInt(), lastError.text().toStdString() };
+ throw Exception { lastError.nativeErrorCode().toInt(), lastError.databaseText().toStdString() };
#else
- throw Exception { lastError.number(), lastError.text().toStdString() };
+ throw Exception { lastError.number(), lastError.databaseText().toStdString() };
#endif
}
}