diff --git a/include/nlohmann/detail/input/json_sax.hpp b/include/nlohmann/detail/input/json_sax.hpp index 34ba6e526..499299267 100644 --- a/include/nlohmann/detail/input/json_sax.hpp +++ b/include/nlohmann/detail/input/json_sax.hpp @@ -242,7 +242,7 @@ class json_sax_exception_handler : public json_sax template - bool handle_exception(const Exception& ex) + bool handle_throw_exception(const Exception& ex) { errored = true; static_cast(ex); @@ -255,13 +255,13 @@ class json_sax_exception_handler : public json_sax virtual bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, const detail::exception& ex) override { - return handle_exception(ex); + return handle_throw_exception(ex); } template bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, const Exception& ex) { - return handle_exception(ex); + return handle_throw_exception(ex); } constexpr bool is_errored() const @@ -439,10 +439,7 @@ class json_sax_dom_callback_parser : public json_sax_exception_handler - { - allow_exceptions_ - } + : root(r), callback(cb), json_sax_exception_handler(allow_exceptions_) { keep_stack.push_back(true); } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 943cd3a3d..ac41da48e 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -6140,7 +6140,7 @@ class json_sax_exception_handler : public json_sax template - bool handle_exception(const Exception& ex) + bool handle_throw_exception(const Exception& ex) { errored = true; static_cast(ex); @@ -6153,13 +6153,13 @@ class json_sax_exception_handler : public json_sax virtual bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, const detail::exception& ex) override { - return handle_exception(ex); + return handle_throw_exception(ex); } template bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, const Exception& ex) { - return handle_exception(ex); + return handle_throw_exception(ex); } constexpr bool is_errored() const @@ -6337,10 +6337,7 @@ class json_sax_dom_callback_parser : public json_sax_exception_handler - { - allow_exceptions_ - } + : root(r), callback(cb), json_sax_exception_handler(allow_exceptions_) { keep_stack.push_back(true); }