]> 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 82bd5d8f274f5c2f21d9173d02dc08ada8ced7c7..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,8 +157,7 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
                     ignoreAttachments,
                     handler);
         } catch (IOException e) {
-            throw new IOErrorException("Error while receiving messages: " + e.getMessage());
-        } catch (InterruptedException ignored) {
+            throw new IOErrorException("Error while receiving messages: " + e.getMessage(), e);
         }
     }
 }