From e45de2a2cf4cc4226e173782883eebd4a36a1f7b Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Fri, 30 May 2025 19:53:53 -0400 Subject: [PATCH] The config now prints a way better error message if you give it a bad file to use. --- config.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.cpp b/config.cpp index d6478d8..d71fe5f 100644 --- a/config.cpp +++ b/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); }