+ private static void checkSendMessageResult(long timestamp, SendMessageResult result) throws DBusExecutionException {
+ String error = ErrorUtils.getErrorMessageFromSendMessageResult(result);
+
+ if (error == null) {
+ return;
+ }
+
+ final String message = timestamp + "\nFailed to send message:\n" + error + '\n';
+
+ if (result.getIdentityFailure() != null) {
+ throw new Error.UntrustedIdentity(message);
+ } else {
+ throw new Error.Failure(message);
+ }
+ }
+
+ private static void checkSendMessageResults(
+ long timestamp, List<SendMessageResult> results
+ ) throws DBusExecutionException {
+ if (results.size() == 1) {
+ checkSendMessageResult(timestamp, results.get(0));
+ return;
+ }
+