0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-03-14 05:20:17 +01:00

ircd::json: Provide a more appropriate type_error to help matrix.org.

This commit is contained in:
Jason Volk 2019-03-19 17:27:37 -07:00
parent 9d7c26b376
commit a6ae9a7c90

View file

@ -2372,6 +2372,17 @@ const try
}
catch(const qi::expectation_failure<const char *> &e)
{
const auto type
{
json::type(*this)
};
if(type != type::OBJECT)
throw type_error
{
"Expected JSON type OBJECT, not %s.", reflect(type)
};
throw expectation_failure<parse_error>
{
e, string_view::begin(), error_show_max