From c26e7c94c63d24ab251d87d309b00f2c050838f3 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 31 Mar 2017 17:00:24 -0700 Subject: [PATCH] Eliminate last usage of Checks::check_throw() --- toolsrc/src/vcpkg.cpp | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 02ad0e9c0..a716bcf65 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -128,15 +128,14 @@ static void loadConfig() auto user_id = keys["User-Id"]; auto user_time = keys["User-Since"]; - Checks::check_throw(VCPKG_LINE_INFO, !user_id.empty() && !user_time.empty(), ""); // Use as goto to the catch statement - - SetUserInformation(user_id, user_time); - return; + if (!user_id.empty() && !user_time.empty()) + { + SetUserInformation(user_id, user_time); + return; + } } } - catch (...) - { - } + catch (...) { } // config file not found, could not be read, or invalid std::string user_id, user_time; @@ -150,9 +149,7 @@ static void loadConfig() << "User-Id: " << user_id << "\n" << "User-Since: " << user_time << "\n"; } - catch (...) - { - } + catch (...) { } } static std::string trim_path_from_command_line(const std::string& full_command_line) @@ -233,17 +230,17 @@ int wmain(const int argc, const wchar_t* const* const argv) fflush(stdout); System::print( - "vcpkg.exe has crashed.\n" - "Please send an email to:\n" - " %s\n" - "containing a brief summary of what you were trying to do and the following data blob:\n" - "\n" - "Version=%s\n" - "EXCEPTION='%s'\n" - "CMD=\n", - Commands::Contact::email(), - Commands::Version::version(), - exc_msg); + "vcpkg.exe has crashed.\n" + "Please send an email to:\n" + " %s\n" + "containing a brief summary of what you were trying to do and the following data blob:\n" + "\n" + "Version=%s\n" + "EXCEPTION='%s'\n" + "CMD=\n", + Commands::Contact::email(), + Commands::Version::version(), + exc_msg); fflush(stdout); for (int x = 0; x < argc; ++x) System::println("%s|", Strings::utf16_to_utf8(argv[x]));