mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 08:31:43 +02:00
Catch Poco::SyntaxException for invalid JSON values
This commit is contained in:
@@ -739,10 +739,16 @@ void JSONTest::testInvalidJanssonFiles()
|
|||||||
parser.setHandler(&handler);
|
parser.setHandler(&handler);
|
||||||
parser.parse(fis);
|
parser.parse(fis);
|
||||||
result = handler.result();
|
result = handler.result();
|
||||||
|
// We shouldn't get here.
|
||||||
|
assert(false);
|
||||||
}
|
}
|
||||||
catch(Poco::JSON::JSONException jsone)
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user