0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-05 13:28:54 +01:00

modules/vm: Simplify error wrapping on propagation.

This commit is contained in:
Jason Volk 2019-04-20 14:51:42 -07:00
parent db539c6268
commit 21a62019f2
2 changed files with 5 additions and 8 deletions

View file

@ -370,7 +370,7 @@ ircd::m::vm::error::error(const http::code &httpcode,
args&&... a)
:m::error
{
child, httpcode, "M_VM_FAULT", fmt, std::forward<args>(a)...
child, httpcode, reflect(code), fmt, std::forward<args>(a)...
}
,code
{

View file

@ -591,11 +591,8 @@ catch(const error &e) // VM FAULT CODE
return handle_error
(
*eval.opts, e.code,
"eval %s %s: %s %s :%s",
"eval %s :%s",
json::get<"event_id"_>(event)?: json::string{"<edu>"},
reflect(e.code),
e.what(),
unquote(json::object(e.content).get("errcode")),
unquote(json::object(e.content).get("error"))
);
}
@ -604,7 +601,7 @@ catch(const m::error &e) // GENERAL MATRIX ERROR
return handle_error
(
*eval.opts, fault::GENERAL,
"eval %s #GP (General Protection): %s %s :%s",
"eval %s (General Protection): %s %s :%s",
json::get<"event_id"_>(event)?: json::string{"<edu>"},
e.what(),
unquote(json::object(e.content).get("errcode")),
@ -616,7 +613,7 @@ catch(const ctx::interrupted &e) // INTERRUPTION
return handle_error
(
*eval.opts, fault::INTERRUPT,
"eval %s #NMI: %s",
"eval %s :%s",
json::get<"event_id"_>(event)?: json::string{"<edu>"},
e.what()
);
@ -626,7 +623,7 @@ catch(const std::exception &e) // ALL OTHER ERRORS
return handle_error
(
*eval.opts, fault::GENERAL,
"eval %s #GP (General Protection): %s",
"eval %s (General Protection): %s",
json::get<"event_id"_>(event)?: json::string{"<edu>"},
e.what()
);