mirror of
https://github.com/hyprwm/hypridle.git
synced 2024-12-22 05:29:49 +01:00
core: Catch sdbus-cpp exception to print better error (#19)
$ hypridle [...] [LOG] wayland done, registering dbus Abort
This commit is contained in:
parent
b9c94ed827
commit
790988d116
1 changed files with 8 additions and 3 deletions
|
@ -430,10 +430,15 @@ void CHypridle::setupDBUS() {
|
|||
auto proxy = sdbus::createProxy("org.freedesktop.login1", "/org/freedesktop/login1");
|
||||
auto method = proxy->createMethodCall("org.freedesktop.login1.Manager", "GetSession");
|
||||
method << "auto";
|
||||
auto reply = proxy->callMethod(method);
|
||||
|
||||
sdbus::ObjectPath path;
|
||||
|
||||
try {
|
||||
auto reply = proxy->callMethod(method);
|
||||
reply >> path;
|
||||
} catch (std::exception& e) {
|
||||
Debug::log(CRIT, "Couldn't connect to logind service ({})", e.what());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Debug::log(LOG, "Using dbus path {}", path.c_str());
|
||||
|
||||
|
|
Loading…
Reference in a new issue