fix(client): catch error on update

This commit is contained in:
Alexis
2018-11-24 11:13:52 +01:00
parent 087de4e956
commit 4cc48b3cfd
2 changed files with 13 additions and 11 deletions

View File

@ -184,7 +184,13 @@ void waybar::Bar::getModules(const Factory& factory, const std::string& pos)
if (pos == "modules-right") {
modules_right_.emplace_back(module);
}
module->dp.connect([module] { module->update(); });
module->dp.connect([module] {
try {
module->update();
} catch (const std::exception& e) {
std::cerr << e.what() << std::endl;
}
});
} catch (const std::exception& e) {
std::cerr << e.what() << std::endl;
}