0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

ircd:Ⓜ️:event: Add parse error reporting with event_id on some ctors.

This commit is contained in:
Jason Volk 2019-09-15 14:39:09 -07:00
parent 2e9e25fc28
commit fdad8445dc

View file

@ -3262,6 +3262,7 @@ ircd::m::event::event(id::buf &buf,
ircd::m::event::event(const json::object &source,
const id &event_id)
try
:super_type
{
source
@ -3280,10 +3281,23 @@ ircd::m::event::event(const json::object &source,
}
{
}
catch(const json::parse_error &e)
{
log::error
{
log, "Event %s from JSON source (%zu bytes) :%s",
event_id?
string_view{event_id}:
"<event_id in source>"_sv,
string_view{source}.size(),
e.what(),
};
}
ircd::m::event::event(const json::object &source,
const id &event_id,
const keys &keys)
try
:super_type
{
source, keys
@ -3302,3 +3316,14 @@ ircd::m::event::event(const json::object &source,
}
{
}
catch(const json::parse_error &e)
{
log::error
{
log, "Event %s from JSON source (%zu bytes) keys:%zu :%s",
string_view{event_id},
string_view{source}.size(),
keys.count(),
e.what(),
};
}