ircd:Ⓜ️:vm::execute: Fix propagation of conformity exceptions masked by opts.

This commit is contained in:
Jason Volk 2023-03-03 15:45:21 -08:00
parent 59072bd622
commit ce7760b213
1 changed files with 17 additions and 1 deletions

View File

@ -346,7 +346,7 @@ try
// Conformity checks only require the event data itself; note that some
// local queries may still be made by the hook, such as m::redacted().
if(likely(opts.phase[phase::CONFORM]) && !opts.edu)
if(likely(opts.phase[phase::CONFORM]) && !opts.edu) try
{
const scope_restore eval_phase
{
@ -355,6 +355,22 @@ try
call_hook(conform_hook, eval, event, eval);
}
catch(const vm::error &e)
{
return handle_fault
(
*eval.opts, e.code, event.event_id,
"eval %s %s :%s :%s",
event.event_id?
string_view{event.event_id}:
"<unknown>"_sv,
json::get<"room_id"_>(event)?
string_view{json::get<"room_id"_>(event)}:
"<unknown>"_sv,
e.what(),
e.content
);
}
// If the event is simply missing content while not being authoritatively
// redacted, the conformity phase would have thrown a prior exception. Now