Report error instead of aborting the application.

This commit is contained in:
eelke 2019-09-26 20:14:57 +02:00
parent 167f5b1386
commit 06a3e8bdcc

View file

@ -164,10 +164,20 @@ void QueryTool::execute()
}
};
if (m_queryParamListController->empty())
m_dbConnection.send(cmd, cb);
else
m_dbConnection.send(cmd, m_queryParamListController->params(), cb);
try {
if (m_queryParamListController->empty())
m_dbConnection.send(cmd, cb);
else
m_dbConnection.send(cmd, m_queryParamListController->params(), cb);
}
catch (const std::exception &ex) {
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
msgBox.setText(QString("Error executing query: %1").arg(QString::fromUtf8(ex.what())));
msgBox.setStandardButtons(QMessageBox::Close);
msgBox.setDefaultButton(QMessageBox::Close);
msgBox.exec();
}
}
}