4 #include "../util/log.hpp"
11 class InstanceMalformedException :
public std::runtime_error {
13 explicit InstanceMalformedException(
const char * what);
18 JsonReader(std::string filename);
28 void parse_resources();
33 get_json(
const char * key)
37 }
catch (
const std::domain_error & e) {
38 BOOST_LOG(l.e()) <<
"Got an error trying to access " << key;
40 }
catch (nlohmann::json::type_error e) {
41 BOOST_LOG(l.e()) <<
"JSON type error:";
42 BOOST_LOG(l.e()) << e.what();
43 BOOST_LOG(l.e()) <<
"Error during access of key '" << key <<
"'";
49 template <
class T,
class json_T>
51 get_json(
const char * key, json_T & js_in)
55 }
catch (
const std::domain_error & e) {
56 BOOST_LOG(l.e()) <<
"Got an error trying to access " << key;
58 }
catch (nlohmann::json::type_error e) {
59 BOOST_LOG(l.e()) <<
"JSON type error:";
60 BOOST_LOG(l.e()) << e.what();
61 BOOST_LOG(l.e()) <<
"Error during access of key '" << key <<
"'";