t/json-validate: catch only json exceptions
the json namespace should really only be throwing json errors. this tool is primarily used for unit testing, so it's better it crashes catastrophically on an unhandled exception.
This commit is contained in:
parent
2fbf9af8cb
commit
456362adff
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "json/flat.hpp"
|
#include "json/flat.hpp"
|
||||||
|
#include "json/except.hpp"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -41,8 +42,8 @@ main (int argc, char ** argv) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
json::flat::parse (boost::filesystem::path (argv[ARG_PATH]));
|
json::flat::parse (boost::filesystem::path (argv[ARG_PATH]));
|
||||||
} catch (std::exception &x) {
|
} catch (const json::error &x) {
|
||||||
std::cerr << "Error: " << x.what () << std::endl;
|
std::cerr << "error: " << x.what () << '\n';
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user