1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor(rawdatabase): Small style refactor

This commit is contained in:
Diadlo 2016-09-13 00:20:18 +03:00
parent 85ee69f008
commit 6c9f77530e
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -541,24 +541,23 @@ void RawDatabase::process()
}
} while (result == SQLITE_ROW);
if (result == SQLITE_ERROR)
{
qWarning() << "Error executing query" << anonymizeQuery(query.query);
if (result == SQLITE_DONE)
continue;
QString anonQuery = anonymizeQuery(query.query);
switch (result) {
case SQLITE_ERROR:
qWarning() << "Error executing query" << anonQuery;
goto cleanupStatements;
}
else if (result == SQLITE_MISUSE)
{
qWarning() << "Misuse executing query" << anonymizeQuery(query.query);
case SQLITE_MISUSE:
qWarning() << "Misuse executing query" << anonQuery;
goto cleanupStatements;
}
else if (result == SQLITE_CONSTRAINT)
{
qWarning() << "Constraint error executing query" << anonymizeQuery(query.query);
case SQLITE_CONSTRAINT:
qWarning() << "Constraint error executing query" << anonQuery;
goto cleanupStatements;
}
else if (result != SQLITE_DONE)
{
qWarning() << "Unknown error"<<result<<"executing query" << anonymizeQuery(query.query);
default:
qWarning() << "Unknown error" << result
<< "executing query" << anonQuery;
goto cleanupStatements;
}
}