Log warning instead fatally failing if Agent registration fails. 10/13810/1
authorOssama Othman <ossama.othman@intel.com>
Mon, 16 Dec 2013 22:53:11 +0000 (14:53 -0800)
committerOssama Othman <ossama.othman@intel.com>
Mon, 16 Dec 2013 22:53:11 +0000 (14:53 -0800)
Change-Id: I2b61e618723308c592f1e3d11d27ebe9a7c4dc1c
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
plugins/connman/agent.cpp
plugins/connman/connman_manager.cpp

index 97f5a14..da792e8 100644 (file)
@@ -75,8 +75,7 @@ namespace
   {
     // This can happen if the appropriate D-Bus policy is not
     // installed, for example.
-    throw std::runtime_error(std::string("Lost name \"")
-                             + name + "\" on D-Bus!");
+    g_warning("Lost name \"%s\" on D-Bus!", name);
   }
 
   // --------------------------------------------------------------
index dae076a..f6d1abc 100644 (file)
@@ -172,8 +172,8 @@ ivi::settings::connman_manager::connman_manager(
   // Register the Agent implementation responsible for handling input
   // requests for secure and hidden networks.
   if (!g_variant_is_object_path(agent_.object_path())) {
-    throw std::runtime_error(std::string("Invalid Agent object path: ")
-                             + agent_.object_path());
+    throw std::invalid_argument(std::string("Invalid Agent object path: ")
+                                + agent_.object_path());
   }
 
   error = nullptr;
@@ -186,8 +186,10 @@ ivi::settings::connman_manager::connman_manager(
   if (ret == nullptr) {
     safe_error.reset(error);
 
-     throw std::runtime_error(
-       std::string("Unable to register agent: ") + error->message);
+    g_warning("Unable to register agent: %s.  "
+              "Hidden and protected connections will "
+              "not be supported.\n",
+              error->message);
   }
 }