From 8e205eeb15a9b296ebc81e00ab7849378c17aa2a Mon Sep 17 00:00:00 2001 From: Mihir Lad Date: Fri, 24 Jul 2020 00:23:31 -0400 Subject: [PATCH] dwm: Connect to socket in try-catch Catch dwmipc errors and throw a module error if connecting to the socket fails. --- src/modules/dwm.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/dwm.cpp b/src/modules/dwm.cpp index 08bfea78..092cc53a 100644 --- a/src/modules/dwm.cpp +++ b/src/modules/dwm.cpp @@ -25,7 +25,11 @@ namespace modules { throw module_error("Could not find socket: " + (socket_path.empty() ? "" : socket_path)); } - m_ipc = factory_util::unique(socket_path); + try { + m_ipc = factory_util::unique(socket_path); + } catch (const dwmipc::IPCError& err) { + throw module_error(err.what()); + } // Load configuration m_formatter->add(