The config now prints a way better error message if you give it a bad file to use.

master
Zed A. Shaw 1 week ago
parent dc8648016d
commit e45de2a2cf
  1. 5
      config.cpp

@ -8,7 +8,10 @@ using fmt::format;
std::filesystem::path Config::BASE_DIR{"."};
Config::Config(const std::string src_path) : $src_path(src_path) {
std::ifstream infile(Config::path_to($src_path));
auto path_to = Config::path_to($src_path);
dbc::check(std::filesystem::exists(path_to),
fmt::format("requested config file {} doesn't exist", path_to.string()));
std::ifstream infile(path_to);
$config = json::parse(infile);
}

Loading…
Cancel
Save