summaryrefslogtreecommitdiff
path: root/platform/qt/src/sqlite3.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-02-13 14:52:49 +0100
committerKonstantin Käfer <mail@kkaefer.com>2018-03-02 14:26:25 +0100
commit5ca38bbde93d273a2a4febb42ff5de53b90e1350 (patch)
tree6b8541ce1eea4c70f28c63cbd5df8cfc580aa665 /platform/qt/src/sqlite3.cpp
parentb0a840e44f0291ee448178995ad2a9ff9b514a4c (diff)
downloadqtlocation-mapboxgl-5ca38bbde93d273a2a4febb42ff5de53b90e1350.tar.gz
[core] refactor SQLite error/status codes
Diffstat (limited to 'platform/qt/src/sqlite3.cpp')
-rw-r--r--platform/qt/src/sqlite3.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/qt/src/sqlite3.cpp b/platform/qt/src/sqlite3.cpp
index eb4a798043..09a3a16002 100644
--- a/platform/qt/src/sqlite3.cpp
+++ b/platform/qt/src/sqlite3.cpp
@@ -24,11 +24,11 @@ namespace mapbox {
namespace sqlite {
// https://www.sqlite.org/rescode.html#ok
-static_assert(mbgl::underlying_type(Exception::OK) == 0, "error");
+static_assert(mbgl::underlying_type(ResultCode::OK) == 0, "error");
// https://www.sqlite.org/rescode.html#cantopen
-static_assert(mbgl::underlying_type(Exception::CANTOPEN) == 14, "error");
+static_assert(mbgl::underlying_type(ResultCode::CantOpen) == 14, "error");
// https://www.sqlite.org/rescode.html#notadb
-static_assert(mbgl::underlying_type(Exception::NOTADB) == 26, "error");
+static_assert(mbgl::underlying_type(ResultCode::NotADB) == 26, "error");
void checkQueryError(const QSqlQuery& query) {
QSqlError lastError = query.lastError();
@@ -57,7 +57,7 @@ void checkDatabaseOpenError(const QSqlDatabase &db) {
// always returns -1 for `nativeErrorCode()` on database errors.
QSqlError lastError = db.lastError();
if (lastError.type() != QSqlError::NoError) {
- throw Exception { Exception::Code::CANTOPEN, "Error opening the database." };
+ throw Exception { ResultCode::CantOpen, "Error opening the database." };
}
}
@@ -74,7 +74,7 @@ public:
: connectionName(QString::number(uint64_t(QThread::currentThread())) + incrementCounter())
{
if (!QSqlDatabase::drivers().contains("QSQLITE")) {
- throw Exception { Exception::Code::CANTOPEN, "SQLite driver not found." };
+ throw Exception { ResultCode::CantOpen, "SQLite driver not found." };
}
assert(!QSqlDatabase::contains(connectionName));