mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::json: Simplify expectation error message.
This commit is contained in:
parent
3649843950
commit
bc9b0e990c
1 changed files with 6 additions and 2 deletions
|
@ -605,9 +605,11 @@ catch(const qi::expectation_failure<const char *> &e)
|
|||
{
|
||||
const auto rule(ircd::string(e.what_));
|
||||
const long size(std::distance(e.first, e.last));
|
||||
throw parse_error("Expected JSON %s. You input %zu invalid characters starting with `%s`.",
|
||||
const long cat(std::distance(start, e.first));
|
||||
throw parse_error("Expected %s. You input %zd invalid characters at position %zd: %s",
|
||||
between(rule, "<", ">"),
|
||||
size,
|
||||
cat,
|
||||
string_view(e.first, e.first + std::min(size, 64L)));
|
||||
}
|
||||
|
||||
|
@ -647,9 +649,11 @@ catch(const qi::expectation_failure<const char *> &e)
|
|||
{
|
||||
const auto rule(ircd::string(e.what_));
|
||||
const long size(std::distance(e.first, e.last));
|
||||
throw parse_error("Expected JSON %s. You input %zu invalid characters starting with `%s`.",
|
||||
const long cat(std::distance(string_view::data(), e.first));
|
||||
throw parse_error("Expected %s. You input %zd invalid characters at position %zd: %s.",
|
||||
between(rule, "<", ">"),
|
||||
size,
|
||||
cat,
|
||||
string_view(e.first, e.first + std::min(size, 64L)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue