You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2019/01/17 11:01:42 UTC

[3/8] james-project git commit: MAILBOX-372 ElasticSearchQuotaMailboxListener should not catch exceptions

MAILBOX-372 ElasticSearchQuotaMailboxListener 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/f2b84ce1
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/f2b84ce1
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/f2b84ce1

Branch: refs/heads/master
Commit: f2b84ce16a402598262ae6a893c228803967a7a7
Parents: 5c301e8
Author: Benoit Tellier <bt...@linagora.com>
Authored: Wed Jan 16 11:43:09 2019 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Thu Jan 17 18:01:13 2019 +0700

----------------------------------------------------------------------
 .../events/ElasticSearchQuotaMailboxListener.java      | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/f2b84ce1/mailbox/plugin/quota-search-elasticsearch/src/main/java/org/apache/james/quota/search/elasticsearch/events/ElasticSearchQuotaMailboxListener.java
----------------------------------------------------------------------
diff --git a/mailbox/plugin/quota-search-elasticsearch/src/main/java/org/apache/james/quota/search/elasticsearch/events/ElasticSearchQuotaMailboxListener.java b/mailbox/plugin/quota-search-elasticsearch/src/main/java/org/apache/james/quota/search/elasticsearch/events/ElasticSearchQuotaMailboxListener.java
index a546492..25c5613 100644
--- a/mailbox/plugin/quota-search-elasticsearch/src/main/java/org/apache/james/quota/search/elasticsearch/events/ElasticSearchQuotaMailboxListener.java
+++ b/mailbox/plugin/quota-search-elasticsearch/src/main/java/org/apache/james/quota/search/elasticsearch/events/ElasticSearchQuotaMailboxListener.java
@@ -28,15 +28,12 @@ import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.events.Group;
 import org.apache.james.quota.search.elasticsearch.QuotaRatioElasticSearchConstants;
 import org.apache.james.quota.search.elasticsearch.json.QuotaRatioToElasticSearchJson;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 
 public class ElasticSearchQuotaMailboxListener implements MailboxListener.GroupMailboxListener {
     private static class ElasticSearchQuotaMailboxListenerGroup extends Group {}
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(ElasticSearchQuotaMailboxListener.class);
     private static final Group GROUP = new ElasticSearchQuotaMailboxListenerGroup();
 
     private final ElasticSearchIndexer indexer;
@@ -56,13 +53,9 @@ public class ElasticSearchQuotaMailboxListener implements MailboxListener.GroupM
     }
 
     @Override
-    public void event(Event event) {
-        try {
-            if (event instanceof QuotaUsageUpdatedEvent) {
-                handleEvent(event.getUser(), (QuotaUsageUpdatedEvent) event);
-            }
-        } catch (Exception e) {
-            LOGGER.error("Can not index quota ratio", e);
+    public void event(Event event) throws JsonProcessingException {
+        if (event instanceof QuotaUsageUpdatedEvent) {
+            handleEvent(event.getUser(), (QuotaUsageUpdatedEvent) event);
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org