0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd:Ⓜ️ Handle json::not_found on index() for more descriptive error.

This commit is contained in:
Jason Volk 2018-11-02 19:36:53 -07:00
parent 6b1fd6c559
commit 5236790228

View file

@ -1391,16 +1391,29 @@ ircd::m::seek(event::fetch &fetch,
ircd::m::event::idx
ircd::m::index(const event &event)
try
{
return index(at<"event_id"_>(event));
}
catch(const json::not_found &)
{
throw m::NOT_FOUND
{
"Cannot find index for event without an event_id."
};
}
ircd::m::event::idx
ircd::m::index(const event &event,
std::nothrow_t)
try
{
return index(at<"event_id"_>(event), std::nothrow);
}
catch(const json::not_found &)
{
return 0;
}
ircd::m::event::idx
ircd::m::index(const event::id &event_id)