private void notifySynchronizeMailboxFailed(Account account, Folder localFolder, Exception exception) { String folderServerId = localFolder.getServerId(); String errorMessage = getRootCauseMessage(exception); for (MessagingListener listener : getListeners()) { listener.synchronizeMailboxFailed(account, folderServerId, errorMessage); } }
public void showSendFailedNotification(Account account, Exception exception) { String title = resourceProvider.sendFailedTitle(); String text = ExceptionHelper.getRootCauseMessage(exception); int notificationId = NotificationIds.getSendFailedNotificationId(account); PendingIntent folderListPendingIntent = actionBuilder.createViewFolderListPendingIntent( account, notificationId); NotificationCompat.Builder builder = notificationHelper .createNotificationBuilder(account, NotificationChannelManager.ChannelType.MISCELLANEOUS) .setSmallIcon(resourceProvider.getIconWarning()) .setWhen(System.currentTimeMillis()) .setAutoCancel(true) .setTicker(title) .setContentTitle(title) .setContentText(text) .setContentIntent(folderListPendingIntent) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setCategory(NotificationCompat.CATEGORY_ERROR); notificationHelper.configureNotification(builder, null, null, NOTIFICATION_LED_FAILURE_COLOR, NOTIFICATION_LED_BLINK_FAST, true); getNotificationManager().notify(notificationId, builder.build()); }
private void syncFolder(Account account, String folder, MessagingListener listener, Folder providedRemoteFolder, Backend remoteMessageStore) { Exception commandException = null; try { processPendingCommandsSynchronous(account); } catch (Exception e) { Timber.e(e, "Failure processing command, but allow message sync attempt"); commandException = e; } // We don't ever sync the Outbox if (folder.equals(account.getOutboxFolder())) { return; } SyncConfig syncConfig = createSyncConfig(account); ControllerSyncListener syncListener = new ControllerSyncListener(account, listener); remoteMessageStore.sync(folder, syncConfig, syncListener, providedRemoteFolder); if (commandException != null && !syncListener.syncFailed) { String rootMessage = getRootCauseMessage(commandException); Timber.e("Root cause failure in %s:%s was '%s'", account.getDescription(), folder, rootMessage); updateFolderStatus(account, folder, rootMessage); listener.synchronizeMailboxFailed(account, folder, rootMessage); } }
String rootMessage = ExceptionHelper.getRootCauseMessage(e); if (backendFolder != null) { try {
String rootMessage = ExceptionHelper.getRootCauseMessage(e); if (backendFolder != null) { try {
String rootMessage = ExceptionHelper.getRootCauseMessage(e); if (backendFolder != null) { try {