From 4ff4a32d66194eb953017709f52fd33a73e68240 Mon Sep 17 00:00:00 2001
From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
Date: Wed, 25 May 2022 17:38:53 -0400
Subject: [PATCH] config: handle multiple exception types when deserializing
 nodes

Any exception other than YAML::Exception was not caught when
loading the account map. We should catch other types of exceptions
as well to prevent a malformed YAML config from preventing daemon
initialization.

Change-Id: If7491fbe97eb8f988edce334a20ddc14e0a0a5fd
Gitlab: #735
---
 src/manager.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/manager.cpp b/src/manager.cpp
index 70cc9e2352..c00490a59f 100644
--- a/src/manager.cpp
+++ b/src/manager.cpp
@@ -2791,8 +2791,14 @@ Manager::loadAccountMap(const YAML::Node& node)
         pluginPreferences.unserialize(node);
 #endif
     } catch (const YAML::Exception& e) {
-        JAMI_ERR("%s: Preferences node unserialize error: ", e.what());
+        JAMI_ERR("Preferences node unserialize YAML exception: %s", e.what());
         ++errorCount;
+    } catch (const std::exception& e) {
+        JAMI_ERR("Preferences node unserialize standard exception: %s", e.what());
+         ++errorCount;
+    } catch (...) {
+        JAMI_ERR("Preferences node unserialize unknown exception");
+         ++errorCount;
     }
 
     const std::string accountOrder = preferences.getAccountOrder();
-- 
GitLab