]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/commands/SendCommand.java
Use exit 4 when sending a single recipient message fails due to untrusted identity key
[signal-cli] / src / main / java / org / asamk / signal / commands / SendCommand.java
index 6d806abccd041cc8e11475e466fd43b3c86bdbc3..73d8f2ed35b8346575a419765a4e718e7de86482 100644 (file)
@@ -66,6 +66,9 @@ public class SendCommand implements DbusCommand {
             } catch (AssertionError e) {
                 handleAssertionError(e);
                 return 1;
+            } catch (Signal.Error.UntrustedIdentity e) {
+                System.err.println("Failed to send message: " + e.getMessage());
+                return 4;
             } catch (DBusExecutionException e) {
                 System.err.println("Failed to send message: " + e.getMessage());
                 return 2;
@@ -118,6 +121,9 @@ public class SendCommand implements DbusCommand {
             } catch (AssertionError e) {
                 handleAssertionError(e);
                 return 1;
+            } catch (Signal.Error.UntrustedIdentity e) {
+                System.err.println("Failed to send message: " + e.getMessage());
+                return 4;
             } catch (DBusExecutionException e) {
                 System.err.println("Failed to send note to self message: " + e.getMessage());
                 return 2;
@@ -134,6 +140,9 @@ public class SendCommand implements DbusCommand {
         } catch (UnknownObject e) {
             System.err.println("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
             return 1;
+        } catch (Signal.Error.UntrustedIdentity e) {
+            System.err.println("Failed to send message: " + e.getMessage());
+            return 4;
         } catch (DBusExecutionException e) {
             System.err.println("Failed to send message: " + e.getMessage());
             return 2;