public void handleCommand(
final Namespace ns, final Manager m, final OutputWriter outputWriter
) throws CommandException {
- boolean ignoreAttachments = ns.getBoolean("ignore-attachments");
+ boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
DBusConnection.DBusBusType busType;
- if (ns.getBoolean("system")) {
+ if (Boolean.TRUE.equals(ns.getBoolean("system"))) {
busType = DBusConnection.DBusBusType.SYSTEM;
} else {
busType = DBusConnection.DBusBusType.SESSION;
}
} catch (DBusException | IOException e) {
logger.error("Dbus command failed", e);
- throw new UnexpectedErrorException("Dbus command failed");
+ throw new UnexpectedErrorException("Dbus command failed", e);
}
}
public void handleCommand(
final Namespace ns, final List<Manager> managers, final SignalCreator c, final OutputWriter outputWriter
) throws CommandException {
- boolean ignoreAttachments = ns.getBoolean("ignore-attachments");
+ boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
DBusConnection.DBusBusType busType;
- if (ns.getBoolean("system")) {
+ if (Boolean.TRUE.equals(ns.getBoolean("system"))) {
busType = DBusConnection.DBusBusType.SYSTEM;
} else {
busType = DBusConnection.DBusBusType.SESSION;
try (var conn = DBusConnection.getConnection(busType)) {
final var signalControl = new DbusSignalControlImpl(c, m -> {
try {
- final var objectPath = DbusConfig.getObjectPath(m.getUsername());
+ final var objectPath = DbusConfig.getObjectPath(m.getSelfNumber());
return run(conn, objectPath, m, outputWriter, ignoreAttachments);
} catch (DBusException e) {
logger.error("Failed to export object", e);
signalControl.run();
} catch (DBusException | IOException e) {
logger.error("Dbus command failed", e);
- throw new UnexpectedErrorException("Dbus command failed");
+ throw new UnexpectedErrorException("Dbus command failed", e);
}
}
break;
} catch (IOException e) {
logger.warn("Receiving messages failed, retrying", e);
- } catch (InterruptedException ignored) {
- break;
}
}
});