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:
parent
9d7c26b376
commit
a6ae9a7c90
1 changed files with 11 additions and 0 deletions
11
ircd/json.cc
11
ircd/json.cc
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue