CollectionBackend: Fix SQL query error message

This commit is contained in:
Jonas Kvinge 2023-04-07 20:54:15 +02:00
parent ef080c3cb1
commit f1a3a12c1c
1 changed files with 5 additions and 7 deletions

View File

@ -105,13 +105,11 @@ void CollectionBackend::ReportErrors(const CollectionQuery &query) {
const QSqlError sql_error = query.lastError(); const QSqlError sql_error = query.lastError();
if (sql_error.isValid()) { if (sql_error.isValid()) {
qLog(Error) << "Unable to execute collection SQL query: " << sql_error; qLog(Error) << "Unable to execute collection SQL query:" << sql_error;
qLog(Error) << "Faulty SQL query: " << query.lastQuery(); qLog(Error) << "Failed SQL query:" << query.lastQuery();
qLog(Error) << "Bound SQL values: " << query.boundValues(); qLog(Error) << "Bound SQL values:" << query.boundValues();
QString error; emit Error(tr("Unable to execute collection SQL query: %1").arg(sql_error.text()));
error += "Unable to execute collection SQL query: " + sql_error.text() + "<br />"; emit Error(tr("Failed SQL query: %1").arg(query.lastQuery()));
error += "Faulty SQL query: " + query.lastQuery();
emit Error(error);
} }
} }