1
0
mirror of https://github.com/pocoproject/poco.git synced 2025-03-26 16:32:45 +01:00

Catch Poco::SyntaxException for invalid JSON values

This commit is contained in:
Franky Braem 2012-05-15 20:52:32 +00:00
parent 5c8e55cd34
commit 425587f499

@ -739,10 +739,16 @@ void JSONTest::testInvalidJanssonFiles()
parser.setHandler(&handler);
parser.parse(fis);
result = handler.result();
// We shouldn't get here.
assert(false);
}
catch(Poco::JSON::JSONException jsone)
{
std::cout << "Exception!!! " << jsone.message() << std::endl;
std::cout << "Ok! We got an exception " << jsone.message() << std::endl;
}
catch(Poco::SyntaxException se)
{
std::cout << "Ok! We got an exception " << se.message() << std::endl;
}
}
}