Skip to content

Commit

Permalink
Better error messages
Browse files Browse the repository at this point in the history
Show better error message in some cirsumstances. This is most notable
when dropping a (database) file onto the structure tree view when no
database file is opened.
  • Loading branch information
MKleusberg committed Oct 20, 2017
1 parent 92a8681 commit 9cff69f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sqlitedb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,10 @@ bool DBBrowserDB::dump(const QString& filename,
bool DBBrowserDB::executeSQL(QString statement, bool dirtyDB, bool logsql)
{
if (!isOpen())
{
lastErrorMessage = tr("No database file opened");
return false;
}

statement = statement.trimmed();

Expand Down Expand Up @@ -715,7 +718,10 @@ bool DBBrowserDB::executeMultiSQL(const QString& statement, bool dirty, bool log
{
// First check if a DB is opened
if(!isOpen())
{
lastErrorMessage = tr("No database file opened");
return false;
}

QString query = statement.trimmed();

Expand Down

0 comments on commit 9cff69f

Please sign in to comment.