mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
modules/m_vm_fetch: Fixes for exception propagation and reporting.
This commit is contained in:
parent
7e99a86512
commit
b95f6e1af4
1 changed files with 45 additions and 1 deletions
|
@ -134,6 +134,10 @@ try
|
|||
if(opts.fetch_state)
|
||||
state(event, eval, room);
|
||||
}
|
||||
catch(const ctx::interrupted &)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::derror
|
||||
|
@ -283,6 +287,10 @@ catch(const vm::error &e)
|
|||
{
|
||||
throw;
|
||||
}
|
||||
catch(const ctx::interrupted &)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::error
|
||||
|
@ -324,6 +332,10 @@ try
|
|||
auth_chain, opts
|
||||
};
|
||||
}
|
||||
catch(const ctx::interrupted &)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::error
|
||||
|
@ -345,6 +357,7 @@ void
|
|||
ircd::m::vm::fetch::state(const event &event,
|
||||
vm::eval &eval,
|
||||
const room &room)
|
||||
try
|
||||
{
|
||||
const event::prev prev{event};
|
||||
const size_t prev_miss
|
||||
|
@ -442,6 +455,22 @@ ircd::m::vm::fetch::state(const event &event,
|
|||
fail,
|
||||
};
|
||||
}
|
||||
catch(const ctx::interrupted &)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::error
|
||||
{
|
||||
log, "%s state fetch in %s :%s",
|
||||
loghead(eval),
|
||||
string_view{room.room_id},
|
||||
e.what(),
|
||||
};
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
std::forward_list
|
||||
<
|
||||
|
@ -647,7 +676,7 @@ ircd::m::vm::fetch::prev_fetch(const event &event,
|
|||
>
|
||||
ret;
|
||||
const event::prev prev{event};
|
||||
for(size_t i(0); i < prev.prev_events_count(); ++i)
|
||||
for(size_t i(0); i < prev.prev_events_count(); ++i) try
|
||||
{
|
||||
const auto &prev_id
|
||||
{
|
||||
|
@ -683,6 +712,21 @@ ircd::m::vm::fetch::prev_fetch(const event &event,
|
|||
|
||||
ret.emplace_front(m::fetch::start(opts));
|
||||
}
|
||||
catch(const ctx::interrupted &)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::derror
|
||||
{
|
||||
log, "%s requesting backfill off prev %s; depth:%ld :%s",
|
||||
loghead(eval),
|
||||
string_view{prev.prev_event(i)},
|
||||
json::get<"depth"_>(event),
|
||||
e.what(),
|
||||
};
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue