Use exit 4 when sending a single recipient message fails due to untrusted identity key

Fixes #88
This commit is contained in:
AsamK 2021-01-16 15:38:38 +01:00
parent e1134d832a
commit 06404667a1
6 changed files with 57 additions and 25 deletions

View 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;