aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-03-31 17:00:24 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-03-31 17:00:24 -0700
commitc26e7c94c63d24ab251d87d309b00f2c050838f3 (patch)
treecf09440992ca3227f46be10792b684157fc5185d /toolsrc/src/vcpkg.cpp
parenta7c13ce724ea9f3853f8a572dbe9b4cdc0672a3d (diff)
downloadvcpkg-c26e7c94c63d24ab251d87d309b00f2c050838f3.tar.gz
vcpkg-c26e7c94c63d24ab251d87d309b00f2c050838f3.zip
Eliminate last usage of Checks::check_throw()
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
-rw-r--r--toolsrc/src/vcpkg.cpp39
1 files 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]));