mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Handle DBusExecutionExceptions
This commit is contained in:
parent
ea8f62a298
commit
239afa07e8
1 changed files with 11 additions and 0 deletions
|
@ -23,6 +23,7 @@ import org.apache.commons.io.IOUtils;
|
|||
import org.asamk.TextSecure;
|
||||
import org.freedesktop.dbus.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
import org.freedesktop.dbus.exceptions.DBusExecutionException;
|
||||
import org.whispersystems.textsecure.api.crypto.UntrustedIdentityException;
|
||||
import org.whispersystems.textsecure.api.messages.*;
|
||||
import org.whispersystems.textsecure.api.messages.multidevice.TextSecureSyncMessage;
|
||||
|
@ -147,6 +148,8 @@ public class Main {
|
|||
handleEncapsulatedExceptions(e);
|
||||
} catch (AssertionError e) {
|
||||
handleAssertionError(e);
|
||||
} catch (DBusExecutionException e) {
|
||||
handleDBusExecutionException(e);
|
||||
}
|
||||
} else {
|
||||
String messageText = ns.getString("message");
|
||||
|
@ -183,6 +186,8 @@ public class Main {
|
|||
System.err.println("Failed to add attachment: " + e.getMessage());
|
||||
System.err.println("Aborting sending.");
|
||||
System.exit(1);
|
||||
} catch (DBusExecutionException e) {
|
||||
handleDBusExecutionException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -324,6 +329,12 @@ public class Main {
|
|||
System.exit(1);
|
||||
}
|
||||
|
||||
private static void handleDBusExecutionException(DBusExecutionException e) {
|
||||
System.err.println("Cannot connect to dbus: " + e.getMessage());
|
||||
System.err.println("Aborting.");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
private static byte[] decodeGroupId(String groupId) {
|
||||
try {
|
||||
return Base64.decode(groupId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue