Add error message when CONTROL file cannot be opened
MODIFY
src/Paragraphs.cpp
src/Paragraphs.cpp
@@ -153,7 +153,13 @@ namespace vcpkg::Paragraphs
std::vector<std::unordered_map<std::string, std::string>> get_paragraphs(const fs::path& control_path)
{
- return parse_paragraphs(Files::read_contents(control_path).get_or_throw());
+ const expected<std::string> contents = Files::read_contents(control_path);
+ if (auto spgh = contents.get())
+ {
+ return parse_paragraphs(*spgh);
+ }
+
+ Checks::exit_with_message("Error while reading %s: %s", control_path.generic_string(), contents.error_code().message());
}
std::vector<std::unordered_map<std::string, std::string>> parse_paragraphs(const std::string& str)

Add error message when CONTROL file cannot be opened