From bc806d4354e037e51881cd58c1dedf18a46146f9 Mon Sep 17 00:00:00 2001 From: Asheem Mamoowala Date: Tue, 21 Aug 2018 15:35:00 -0700 Subject: Use QSqlError::databaseText for reporting errors from SQLite wrapper to match SQLite3 error messages --- platform/qt/src/sqlite3.cpp | 8 ++++---- 1 file 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 } } -- cgit v1.2.1