- private static DBusExecutionException convertEncapsulatedExceptions(EncapsulatedExceptions e) {
- if (e.getNetworkExceptions().size() + e.getUnregisteredUserExceptions().size() + e.getUntrustedIdentityExceptions().size() == 1) {
- if (e.getNetworkExceptions().size() == 1) {
- NetworkFailureException n = e.getNetworkExceptions().get(0);
- return new Error.Failure("Network failure for \"" + n.getE164number() + "\": " + n.getMessage());
- } else if (e.getUnregisteredUserExceptions().size() == 1) {
- UnregisteredUserException n = e.getUnregisteredUserExceptions().get(0);
- return new Error.UnregisteredUser("Unregistered user \"" + n.getE164Number() + "\": " + n.getMessage());
- } else if (e.getUntrustedIdentityExceptions().size() == 1) {
- UntrustedIdentityException n = e.getUntrustedIdentityExceptions().get(0);
- return new Error.UntrustedIdentity("Untrusted Identity for \"" + n.getIdentifier() + "\": " + n.getMessage());
- }
+ private static void checkSendMessageResults(
+ long timestamp, List<SendMessageResult> results
+ ) throws DBusExecutionException {
+ List<String> errors = ErrorUtils.getErrorMessagesFromSendMessageResults(results);
+ if (errors.size() == 0) {
+ return;