mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd:Ⓜ️:vm: Properly propagate a context interruption to the evaluator.
This commit is contained in:
parent
56234556e8
commit
45f8239f9b
2 changed files with 14 additions and 0 deletions
|
@ -72,6 +72,7 @@ enum ircd::m::vm::fault
|
|||
GENERAL = 0x10, ///< General protection fault. (#gp)
|
||||
EVENT = 0x20, ///< Eval requires addl events in the ef register (#ef)
|
||||
STATE = 0x40, ///< Required state is missing (#st)
|
||||
INTERRUPT = 0x80, ///< ctx::interrupted (#nmi)
|
||||
};
|
||||
|
||||
/// Evaluation Options
|
||||
|
|
13
ircd/m/vm.cc
13
ircd/m/vm.cc
|
@ -308,6 +308,19 @@ catch(const error &e)
|
|||
|
||||
throw;
|
||||
}
|
||||
catch(const ctx::interrupted &e)
|
||||
{
|
||||
if(opts->errorlog & fault::INTERRUPT)
|
||||
log.error("eval %s: #NMI: %s",
|
||||
json::get<"event_id"_>(event)?: json::string{"<edu>"},
|
||||
e.what());
|
||||
|
||||
if(opts->warnlog & fault::INTERRUPT)
|
||||
log.warning("eval %s: #NMI: %s",
|
||||
json::get<"event_id"_>(event)?: json::string{"<edu>"},
|
||||
e.what());
|
||||
throw;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
if(opts->errorlog & fault::GENERAL)
|
||||
|
|
Loading…
Reference in a new issue