More descriptive sqlite errors
This commit is contained in:
parent
9baf5483e7
commit
03b12786cf
@ -50,7 +50,7 @@ QSqlDatabase LibraryBackend::Connect() {
|
|||||||
db = QSqlDatabase::addDatabase("QSQLITE", connection_id);
|
db = QSqlDatabase::addDatabase("QSQLITE", connection_id);
|
||||||
db.setDatabaseName(directory_ + "/" + kDatabaseName);
|
db.setDatabaseName(directory_ + "/" + kDatabaseName);
|
||||||
if (!db.open()) {
|
if (!db.open()) {
|
||||||
emit Error(db.lastError().text());
|
emit Error("LibraryBackend: " + db.lastError().text());
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ QSqlDatabase LibraryBackend::Connect() {
|
|||||||
bool LibraryBackend::CheckErrors(const QSqlError& error) {
|
bool LibraryBackend::CheckErrors(const QSqlError& error) {
|
||||||
if (error.isValid()) {
|
if (error.isValid()) {
|
||||||
qDebug() << error;
|
qDebug() << error;
|
||||||
emit Error(error.text());
|
emit Error("LibraryBackend: " + error.text());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user