mirror of
https://github.com/tristanpenman/valijson.git
synced 2025-03-03 21:06:25 +01:00
Fix exception type and error message in poco_json_utils.hpp
This commit is contained in:
parent
2de198ea2e
commit
c08413d010
@ -4,8 +4,10 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <Poco/JSON/JSONException.h>
|
||||||
#include <Poco/JSON/Object.h>
|
#include <Poco/JSON/Object.h>
|
||||||
#include <Poco/JSON/Parser.h>
|
#include <Poco/JSON/Parser.h>
|
||||||
|
|
||||||
#include <valijson/utils/file_utils.hpp>
|
#include <valijson/utils/file_utils.hpp>
|
||||||
|
|
||||||
namespace valijson {
|
namespace valijson {
|
||||||
@ -23,8 +25,8 @@ inline bool loadDocument(const std::string &path, Poco::Dynamic::Var &document)
|
|||||||
// Parse schema
|
// Parse schema
|
||||||
try {
|
try {
|
||||||
document = Poco::JSON::Parser().parse(file);
|
document = Poco::JSON::Parser().parse(file);
|
||||||
} catch (std::invalid_argument const& exception) {
|
} catch (Poco::Exception const& exception) {
|
||||||
std::cerr << "nlohmann::json failed to parse the document\n"
|
std::cerr << "Poco::JSON failed to parse the document\n"
|
||||||
<< "Parse error:" << exception.what() << "\n";
|
<< "Parse error:" << exception.what() << "\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user