Skip to content

Commit

Permalink
fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pboettch committed Nov 27, 2023
1 parent 74931bd commit 08d8a52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/json-validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ class numeric : public schema
oss.seekp(0, std::ios::end);
auto size = oss.tellp();
if (size != 0) {
oss.seekp(0, std::ios::beg);
oss.seekp(0, std::ios::beg);
e.error(ptr, instance, oss.str());
}
}
Expand Down
6 changes: 3 additions & 3 deletions test/issue-255-error-message-limit-precision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ class custom_error_handler : public nlohmann::json_schema::basic_error_handler
{
void error(const nlohmann::json::json_pointer &ptr, const json &instance, const std::string &message) override
{
if (message != "instance exceeds maximum of 3.141592653589793")
throw std::invalid_argument("Precision print does not work.");
if (message != "instance exceeds maximum of 3.141592653589793")
throw std::invalid_argument("Precision print does not work.");
}
};

int main(void)
{
json_validator validator;

auto instance = R"({ "angle": 3.1415927410125732 })"_json;
auto instance = R"({ "angle": 3.1415927410125732 })"_json;

validator.set_root_schema(schema);
custom_error_handler err;
Expand Down

0 comments on commit 08d8a52

Please sign in to comment.