mirror of
https://github.com/hyprwm/hypridle.git
synced 2024-12-22 13:39:47 +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 proxy = sdbus::createProxy("org.freedesktop.login1", "/org/freedesktop/login1");
|
||||||
auto method = proxy->createMethodCall("org.freedesktop.login1.Manager", "GetSession");
|
auto method = proxy->createMethodCall("org.freedesktop.login1.Manager", "GetSession");
|
||||||
method << "auto";
|
method << "auto";
|
||||||
auto reply = proxy->callMethod(method);
|
|
||||||
|
|
||||||
sdbus::ObjectPath path;
|
sdbus::ObjectPath path;
|
||||||
|
|
||||||
|
try {
|
||||||
|
auto reply = proxy->callMethod(method);
|
||||||
reply >> path;
|
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());
|
Debug::log(LOG, "Using dbus path {}", path.c_str());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue