MAILBOX-372 ListeningCurrentQuotaUpdater should not catch exceptions
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/b7df724b Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/b7df724b Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/b7df724b Branch: refs/heads/master Commit: b7df724bb413381f7212b5e54027fcc3abbaf51e Parents: f2b84ce Author: Benoit Tellier <[email protected]> Authored: Wed Jan 16 11:44:36 2019 +0700 Committer: Benoit Tellier <[email protected]> Committed: Thu Jan 17 18:01:13 2019 +0700 ---------------------------------------------------------------------- .../quota/ListeningCurrentQuotaUpdater.java | 31 ++++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/b7df724b/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/ListeningCurrentQuotaUpdater.java ---------------------------------------------------------------------- diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/ListeningCurrentQuotaUpdater.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/ListeningCurrentQuotaUpdater.java index 251541b..57cee5a 100644 --- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/ListeningCurrentQuotaUpdater.java +++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/ListeningCurrentQuotaUpdater.java @@ -34,15 +34,12 @@ import org.apache.james.mailbox.model.QuotaRoot; import org.apache.james.mailbox.quota.QuotaManager; import org.apache.james.mailbox.quota.QuotaRootResolver; import org.apache.james.mailbox.store.event.EventFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import com.google.common.collect.ImmutableSet; public class ListeningCurrentQuotaUpdater implements MailboxListener.GroupMailboxListener, QuotaUpdater { private static class ListeningCurrentQuotaUpdaterGroup extends Group {} - private static final Logger LOGGER = LoggerFactory.getLogger(ListeningCurrentQuotaUpdater.class); public static final Group GROUP = new ListeningCurrentQuotaUpdaterGroup(); private static final ImmutableSet<RegistrationKey> NO_REGISTRATION_KEYS = ImmutableSet.of(); @@ -65,22 +62,18 @@ public class ListeningCurrentQuotaUpdater implements MailboxListener.GroupMailbo } @Override - public void event(Event event) { - try { - if (event instanceof Added) { - Added addedEvent = (Added) event; - QuotaRoot quotaRoot = quotaRootResolver.getQuotaRoot(addedEvent.getMailboxId()); - handleAddedEvent(addedEvent, quotaRoot); - } else if (event instanceof Expunged) { - Expunged expungedEvent = (Expunged) event; - QuotaRoot quotaRoot = quotaRootResolver.getQuotaRoot(expungedEvent.getMailboxId()); - handleExpungedEvent(expungedEvent, quotaRoot); - } else if (event instanceof MailboxDeletion) { - MailboxDeletion mailboxDeletionEvent = (MailboxDeletion) event; - handleMailboxDeletionEvent(mailboxDeletionEvent); - } - } catch (MailboxException e) { - LOGGER.error("Error while updating quotas", e); + public void event(Event event) throws MailboxException { + if (event instanceof Added) { + Added addedEvent = (Added) event; + QuotaRoot quotaRoot = quotaRootResolver.getQuotaRoot(addedEvent.getMailboxId()); + handleAddedEvent(addedEvent, quotaRoot); + } else if (event instanceof Expunged) { + Expunged expungedEvent = (Expunged) event; + QuotaRoot quotaRoot = quotaRootResolver.getQuotaRoot(expungedEvent.getMailboxId()); + handleExpungedEvent(expungedEvent, quotaRoot); + } else if (event instanceof MailboxDeletion) { + MailboxDeletion mailboxDeletionEvent = (MailboxDeletion) event; + handleMailboxDeletionEvent(mailboxDeletionEvent); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
