]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/commands/ReceiveCommand.java
Implement configuration handling
[signal-cli] / src / main / java / org / asamk / signal / commands / ReceiveCommand.java
index f248d6628d9a34fa6cf988e840862a04dcb2bcbd..4686f26dbcabecc409898ecf56d29fb060badaa9 100644 (file)
@@ -126,7 +126,7 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
             }
         } catch (DBusException e) {
             logger.error("Dbus client failed", e);
-            throw new UnexpectedErrorException("Dbus client failed");
+            throw new UnexpectedErrorException("Dbus client failed", e);
         }
         while (true) {
             try {
@@ -147,7 +147,7 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
             returnOnTimeout = false;
             timeout = 3600;
         }
-        boolean ignoreAttachments = ns.getBoolean("ignore-attachments");
+        boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
         try {
             final var handler = outputWriter instanceof JsonWriter ? new JsonReceiveMessageHandler(m,
                     (JsonWriter) outputWriter) : new ReceiveMessageHandler(m, (PlainTextWriter) outputWriter);
@@ -157,7 +157,7 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
                     ignoreAttachments,
                     handler);
         } catch (IOException e) {
-            throw new IOErrorException("Error while receiving messages: " + e.getMessage());
+            throw new IOErrorException("Error while receiving messages: " + e.getMessage(), e);
         }
     }
 }