dwm: Connect to socket in try-catch
Catch dwmipc errors and throw a module error if connecting to the socket fails.
This commit is contained in:
parent
16f90bea83
commit
8e205eeb15
1 changed files with 5 additions and 1 deletions
|
@ -25,7 +25,11 @@ namespace modules {
|
||||||
throw module_error("Could not find socket: " + (socket_path.empty() ? "<empty>" : socket_path));
|
throw module_error("Could not find socket: " + (socket_path.empty() ? "<empty>" : socket_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ipc = factory_util::unique<dwmipc::Connection>(socket_path);
|
try {
|
||||||
|
m_ipc = factory_util::unique<dwmipc::Connection>(socket_path);
|
||||||
|
} catch (const dwmipc::IPCError& err) {
|
||||||
|
throw module_error(err.what());
|
||||||
|
}
|
||||||
|
|
||||||
// Load configuration
|
// Load configuration
|
||||||
m_formatter->add(
|
m_formatter->add(
|
||||||
|
|
Loading…
Reference in a new issue