Pgsql::Connection::connect functions now all report connection errors

by throwing exception.
This commit is contained in:
eelke 2019-11-03 07:58:48 +01:00
parent 05bca069e3
commit c5f6da48ce
5 changed files with 35 additions and 39 deletions

View file

@ -48,11 +48,7 @@ TypeSelectionItemModel* OpenDatabase::typeSelectionModel()
void OpenDatabase::refresh()
{
Pgsql::Connection conn;
std::string connstr = m_config.connectionString().toStdString();
if (conn.connect(connstr.c_str())) {
m_catalog->loadAll(conn, nullptr);
}
else {
qDebug() << "Connect failed connstr: " << connstr.c_str();
}
auto connstr = m_config.connectionString();
conn.connect(connstr);
m_catalog->loadAll(conn, nullptr);
}