mirror of
https://github.com/matrix-construct/construct
synced 2025-01-05 20:34:29 +01:00
ircd:Ⓜ️:vm::execute: Fix propagation of conformity exceptions masked by opts.
This commit is contained in:
parent
59072bd622
commit
ce7760b213
1 changed files with 17 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue