diff --git a/include/jsonrpcpp.hpp b/include/jsonrpcpp.hpp index e23e2b7..51b6e7a 100644 --- a/include/jsonrpcpp.hpp +++ b/include/jsonrpcpp.hpp @@ -1249,8 +1249,10 @@ inline entity_ptr Parser::do_parse(const std::string& json_str) { throw ParseErrorException(e.what()); } - - return nullptr; + catch (...) + { + return nullptr; + } } inline entity_ptr Parser::do_parse_json(const Json& json) diff --git a/test/test_main.cpp b/test/test_main.cpp index 42781b5..b0d9c5d 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -1,14 +1,18 @@ /*** This file is part of jsonrpc++ - Copyright (C) 2017-2021 Johannes Pohl + Copyright (C) 2017-2024 Johannes Pohl This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details. ***/ -#include +// local headers #include "jsonrpcpp.hpp" +// 3rd party headers +#include + + using namespace std; TEST_CASE("Main test")