feature/knowledge_base #3

Merged
cromer merged 9 commits from feature/knowledge_base into develop 2022-11-09 16:52:23 -03:00
2 changed files with 14 additions and 6 deletions
Showing only changes of commit 2dc643ed39 - Show all commits

View File

@ -51,12 +51,15 @@ void obelisk::KnowledgeBase::createTable(std::function<const char*()> function)
if (result != SQLITE_OK)
{
logSqliteError(result);
throw obelisk::KnowledgeBaseException("something happened");
}
if (tmp)
{
std::string errmsg(tmp);
throw obelisk::KnowledgeBaseException(errmsg);
if (tmp)
{
std::string errmsg(tmp);
throw obelisk::KnowledgeBaseException(errmsg);
}
else
{
throw obelisk::KnowledgeBaseException();
}
}
}

View File

@ -43,6 +43,11 @@ namespace obelisk
const std::string errorMessage_;
public:
KnowledgeBaseException() :
errorMessage_("an unknown error occured")
{
}
KnowledgeBaseException(const std::string& errorMessage) :
errorMessage_(errorMessage)
{