develop #5
@ -51,13 +51,16 @@ void obelisk::KnowledgeBase::createTable(std::function<const char*()> function)
|
|||||||
if (result != SQLITE_OK)
|
if (result != SQLITE_OK)
|
||||||
{
|
{
|
||||||
logSqliteError(result);
|
logSqliteError(result);
|
||||||
throw obelisk::KnowledgeBaseException("something happened");
|
|
||||||
}
|
|
||||||
if (tmp)
|
if (tmp)
|
||||||
{
|
{
|
||||||
std::string errmsg(tmp);
|
std::string errmsg(tmp);
|
||||||
throw obelisk::KnowledgeBaseException(errmsg);
|
throw obelisk::KnowledgeBaseException(errmsg);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw obelisk::KnowledgeBaseException();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: log files?
|
// TODO: log files?
|
||||||
|
@ -43,6 +43,11 @@ namespace obelisk
|
|||||||
const std::string errorMessage_;
|
const std::string errorMessage_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
KnowledgeBaseException() :
|
||||||
|
errorMessage_("an unknown error occured")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
KnowledgeBaseException(const std::string& errorMessage) :
|
KnowledgeBaseException(const std::string& errorMessage) :
|
||||||
errorMessage_(errorMessage)
|
errorMessage_(errorMessage)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user