json-related refactor
This commit is contained in:
+2
-2
@@ -1,5 +1,6 @@
|
||||
#include "files.hpp"
|
||||
|
||||
#include "../coders/commons.hpp"
|
||||
#include "../coders/json.hpp"
|
||||
#include "../coders/gzip.hpp"
|
||||
#include "../util/stringutil.hpp"
|
||||
@@ -107,8 +108,7 @@ bool files::write_binary_json(fs::path filename, const dynamic::Map* obj, bool c
|
||||
std::shared_ptr<dynamic::Map> files::read_json(fs::path filename) {
|
||||
std::string text = files::read_string(filename);
|
||||
try {
|
||||
auto obj = json::parse(filename.string(), text);
|
||||
return obj;
|
||||
return json::parse(filename.string(), text);;
|
||||
} catch (const parsing_error& error) {
|
||||
std::cerr << error.errorLog() << std::endl;
|
||||
throw std::runtime_error("could not to parse "+filename.string());
|
||||
|
||||
Reference in New Issue
Block a user