From 4533cf5003347f05e69c7f5a7734774d57cf821a Mon Sep 17 00:00:00 2001 From: Mihir Lad Date: Thu, 23 Jul 2020 16:20:58 -0400 Subject: [PATCH] dwm: Catch IPCError instead of generic exceptions Don't catch generic exceptions to avoid masking bugs. Only catch IPCError exceptions since those are all minor errors. --- src/modules/dwm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/dwm.cpp b/src/modules/dwm.cpp index 251c4a1c..2e23f575 100644 --- a/src/modules/dwm.cpp +++ b/src/modules/dwm.cpp @@ -153,7 +153,7 @@ namespace modules { } catch (const dwmipc::SocketClosedError& err) { m_log.err("%s: Disconnected from socket: %s", name(), err.what()); return reconnect_dwm(); - } catch (const exception& err) { + } catch (const dwmipc::IPCError& err) { m_log.err("%s: Failed to handle event (reason: %s)", name(), err.what()); } return false; @@ -403,7 +403,7 @@ namespace modules { m_log.notice("%s: Successfully reconnected event to socket", name()); } return true; - } catch (const exception& err) { + } catch (const dwmipc::IPCError& err) { m_log.err("%s: Failed to reconnect to socket: %s", name(), err.what()); } return false;