fix(main-db): add logs

This commit is contained in:
Ronan Abhamon 2017-10-26 10:39:26 +02:00
parent c5ad52bd42
commit 42e2f7f6ef
2 changed files with 6 additions and 2 deletions

View file

@ -1061,7 +1061,7 @@ MainDb::MainDb (Core *core) : AbstractDb(*new MainDbPrivate) {
d->insertChatRoom(d->insertSipAddress(peerAddress), capabilities, Utils::getLongAsTm(0));
}
void MainDb::deleteChatRoom (const std::string &peerAddress) {
void MainDb::deleteChatRoom (const string &peerAddress) {
L_D();
L_BEGIN_LOG_EXCEPTION

View file

@ -22,6 +22,7 @@
#endif // ifdef SOCI_ENABLED
#include "db-session-p.h"
#include "logger/logger.h"
#include "object/object-p.h"
#include "db-session-provider.h"
@ -59,9 +60,12 @@ DbSession DbSessionProvider::getSession (const string &uri) {
d->sessions[uri] = make_pair(backendSession, p);
} else // Share session.
session.setRef(*d->sessions[uri].second);
} catch (const exception &) {}
} catch (const exception &e) {
lWarning() << "Unable to get db session: " << e.what();
}
#else
DbSession session(DbSession::None);
lWarning() << "Unable to get db session: soci not enabled.";
#endif // ifdef SOCI_ENABLED
// Remove invalid weak ptrs.