From 4b7796d215f98a1a937e291a3946519fd2705a9d Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Thu, 12 Nov 2015 12:05:26 -0800 Subject: [PATCH] Catch exception from notification request #4932 --- src/lib/synergy/ToolApp.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/synergy/ToolApp.cpp b/src/lib/synergy/ToolApp.cpp index 74d1cacf..0549c396 100644 --- a/src/lib/synergy/ToolApp.cpp +++ b/src/lib/synergy/ToolApp.cpp @@ -30,7 +30,7 @@ #include "platform/MSWindowsSession.h" #endif -#define JSON_URL "https://test.synergy-project.org/premium/json/" +#define JSON_URL "http://test.synergy-project.org/premium/json/" enum { kErrorOk, @@ -219,9 +219,17 @@ ToolApp::notifyActivation() ss << "&os=" << ARCH->internet().urlEncode(ARCH->getOSName()); ss << "&arch=" << ARCH->internet().urlEncode(ARCH->getPlatformName()); - std::cout << ARCH->internet().get(ss.str()) << std::endl; + try { + std::cout << ARCH->internet().get(ss.str()) << std::endl; + } + catch (std::exception& e) { + LOG((CLOG_CRIT "An error occurred during notification: %s\n", e.what())); + } + catch (...) { + LOG((CLOG_CRIT "An unknown error occurred during notification.\n")); + } } else { - LOG((CLOG_DEBUG "notify activation failed")); + LOG((CLOG_DEBUG "notification failed")); } }