some thoughts about exceptions

This commit is contained in:
Blue 2022-09-09 20:15:40 +03:00
parent c3139974f1
commit c491793387
Signed by: blue
GPG key ID: 9B203B252A63EE38
9 changed files with 276 additions and 59 deletions

View file

@ -89,10 +89,11 @@ QString Core::DataBase::getName() const
template <class K, class V>
Core::DataBase::Table<K, V>* Core::DataBase::addTable(const QString& p_name) {
std::string nm = p_name.toStdString();
if (opened) {
throw Core::DataBase::Opened(name);
throw Core::DataBase::Opened(name, nm);
}
Core::DataBase::Table<K, V>* table = new Core::DataBase::Table<K, V>();
tables.insert(std::make_pair(p_name.toStdString(), table));
Core::DataBase::Table<K, V>* table = new Core::DataBase::Table<K, V>(nm, this);
tables.insert(std::make_pair(nm, table));
return table;
}