MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / parse_error_example

Function parse_error_example

examples/src/json_parse_examples.cpp:84–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void parse_error_example()
85{
86 std::string s = "[1,2,3,4,]";
87 try
88 {
89 json val = json::parse(s);
90 }
91 catch(const ser_error& e)
92 {
93 std::cout << "Caught ser_error with category " << e.code().category().name()
94 << ", code " << e.code().value()
95 << " and message " << e.what() << '\n';
96 }
97}
98
99void max_nesting_path_example()
100{

Callers 1

mainFunction · 0.85

Calls 6

parseFunction · 0.85
nameMethod · 0.45
categoryMethod · 0.45
codeMethod · 0.45
valueMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected