From 7fe735c02e37057596396d42b17caef3169415b0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 18:00:43 -0800 Subject: Add error message when CONTROL file cannot be opened --- toolsrc/src/Paragraphs.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index d99ad45cf..f4592afed 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -41,8 +41,8 @@ namespace vcpkg::Paragraphs static bool is_alphanum(char ch) { return (ch >= 'A' && ch <= 'Z') - || (ch >= 'a' && ch <= 'z') - || (ch >= '0' && ch <= '9'); + || (ch >= 'a' && ch <= 'z') + || (ch >= '0' && ch <= '9'); } static bool is_lineend(char ch) @@ -153,7 +153,13 @@ namespace vcpkg::Paragraphs std::vector> get_paragraphs(const fs::path& control_path) { - return parse_paragraphs(Files::read_contents(control_path).get_or_throw()); + const expected 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> parse_paragraphs(const std::string& str) -- cgit v1.2.3