Commit 4c0bd932 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

sqlite: Include sqlite error as crash error message

At the moment it's only printing the issue as a warning, this will
include it in the backtrace, making it a bit easier to share when you
report.

I keep having this crash and I have no idea what's wrong.
parent 25bf04d9
......@@ -52,6 +52,7 @@ find_package (Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core DBus Widgets
# KDE Frameworks
find_package (KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package (KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package (KF5Crash ${KF5_MIN_VERSION} CONFIG REQUIRED)
# Basic includes
include (CPack)
......
......@@ -46,6 +46,7 @@ target_link_libraries (
KF5::KIOCore
KF5::DBusAddons
KF5::CoreAddons
KF5::Crash
kactivitymanagerd_plugin
)
......
......@@ -7,6 +7,7 @@
#ifndef PLUGINS_SQLITE_DATABASE_UTILS_H
#define PLUGINS_SQLITE_DATABASE_UTILS_H
#include <KCrash>
#include <QSqlError>
#include <QSqlQuery>
#include <common/database/schema/ResourcesDatabaseSchema.h>
......@@ -49,6 +50,7 @@ inline bool exec(Common::Database &database, ErrorHandling eh, QSqlQuery &query)
if ((!success) && (errorCount++ < 2)) {
qCWarning(KAMD_LOG_RESOURCES) << query.lastQuery();
qCWarning(KAMD_LOG_RESOURCES) << query.lastError();
KCrash::setErrorMessage(query.lastError().text());
}
Q_ASSERT_X(success, "Uils::exec", qPrintable(QStringLiteral("Query failed:") + query.lastError().text()));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment