diff --git a/src/linkahead/utility.cpp b/src/linkahead/utility.cpp index fe229d16976c5abd9b9090bb06de7c67917248b1..21521ecd83fc3de4e334254d3c912bb7dc687997 100644 --- a/src/linkahead/utility.cpp +++ b/src/linkahead/utility.cpp @@ -108,6 +108,10 @@ template <> auto getEnumValueFromName<Role>(const std::string &name) -> Role { auto load_string_file(const path &file_path) -> std::string { std::string result; + if (!exists(file_path)) { + throw std::runtime_error("File not found: " + file_path.string()); + } + // adapted from boost::filesystem::load_string_file, which was removed in 1.84 std::ifstream file; file.exceptions(std::ios_base::failbit | std::ios_base::badbit);