0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-10 14:08:56 +02:00

modules/vm: Improve derror log output on call_hook().

This commit is contained in:
Jason Volk 2019-07-15 16:41:04 -07:00
parent 449f667dd9
commit 76ed65d36e

View file

@ -605,7 +605,7 @@ catch(const m::error &e) // GENERAL MATRIX ERROR
return handle_error
(
*eval.opts, fault::GENERAL,
"eval %s (General Protection) :%s %s :%s",
"eval %s (General Protection) :%s :%s :%s",
event.event_id? string_view{event.event_id}: "<edu>"_sv,
e.what(),
unquote(json::object(e.content).get("errcode")),
@ -916,6 +916,33 @@ try
{
hook(event, std::forward<T>(data));
}
catch(const m::error &e)
{
log::derror
{
"%s | phase:%s :%s :%s :%s",
loghead(eval),
unquote(hook.feature.get("name")),
e.what(),
e.errcode(),
e.errstr(),
};
throw;
}
catch(const http::error &e)
{
log::derror
{
"%s | phase:%s :%s :%s",
loghead(eval),
unquote(hook.feature.get("name")),
e.what(),
e.content,
};
throw;
}
catch(const std::exception &e)
{
log::derror