summaryrefslogtreecommitdiff
path: root/platform/qt
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-28 07:14:54 -0700
commitbc806d4354e037e51881cd58c1dedf18a46146f9 (patch)
tree8d5a402d656b4e2757fde7993b0b5d645d174149 /platform/qt
parentfcab3a81cd368c4af2c2ba95f466b3d4a11e2187 (diff)
downloadqtlocation-mapboxgl-bc806d4354e037e51881cd58c1dedf18a46146f9.tar.gz
Use QSqlError::databaseText for reporting errors from SQLite wrapper to match SQLite3 error messages
Diffstat (limited to 'platform/qt')
-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
}
}