0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-29 20:28:52 +02:00

ircd:Ⓜ️:dbs: Log errors on write here.

This commit is contained in:
Jason Volk 2019-05-13 12:46:38 -07:00
parent 304c6df468
commit 9700f38fc5

View file

@ -219,6 +219,7 @@ void
ircd::m::dbs::write(db::txn &txn, ircd::m::dbs::write(db::txn &txn,
const event &event, const event &event,
const write_opts &opts) const write_opts &opts)
try
{ {
if(opts.event_idx == 0 && opts.blacklist) if(opts.event_idx == 0 && opts.blacklist)
return blacklist(txn, at<"event_id"_>(event), opts); return blacklist(txn, at<"event_id"_>(event), opts);
@ -233,6 +234,17 @@ ircd::m::dbs::write(db::txn &txn,
if(json::get<"room_id"_>(event)) if(json::get<"room_id"_>(event))
_index_room(txn, event, opts); _index_room(txn, event, opts);
} }
catch(const std::exception &e)
{
log::error
{
log, "Event %s txn building error :%s",
json::get<"event_id"_>(event),
e.what()
};
throw;
}
void void
ircd::m::dbs::blacklist(db::txn &txn, ircd::m::dbs::blacklist(db::txn &txn,