mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
Fix error handling in open database procedure
When opening a database fails a proper error message is now shown which hopefully tells the user what the source of the problem is. Note: this will only work for newer versions of SQLite. This requires a bug fix which is included in this commit. The error message wasn't taken from the correct database handle, so it had nothing to do with the actual error source. This is fixed by this commit as well.
This commit is contained in:
@@ -307,7 +307,7 @@ bool MainWindow::fileOpen(const QString& fileName, bool dontAddToRecentFiles, bo
|
||||
loadPragmas();
|
||||
retval = true;
|
||||
} else {
|
||||
QMessageBox::warning(this, qApp->applicationName(), tr("Invalid file format."));
|
||||
QMessageBox::warning(this, qApp->applicationName(), tr("Could not open database file.\nReason: %1").arg(db.lastErrorMessage));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user