This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
     new effc90e222 [FIX] Avoid a worring error log upon state not found (#2155)
effc90e222 is described below

commit effc90e2227fb3671902ae9cc1fa5664fee929d6
Author: Benoit TELLIER <btell...@linagora.com>
AuthorDate: Tue Mar 26 08:49:07 2024 +0100

    [FIX] Avoid a worring error log upon state not found (#2155)
---
 .../main/scala/org/apache/james/jmap/method/EmailChangesMethod.scala    | 2 ++
 .../main/scala/org/apache/james/jmap/method/MailboxChangesMethod.scala  | 2 ++
 2 files changed, 4 insertions(+)

diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/EmailChangesMethod.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/EmailChangesMethod.scala
index c4e7f8fc0e..6d3af0de3a 100644
--- 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/EmailChangesMethod.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/EmailChangesMethod.scala
@@ -22,6 +22,7 @@ package org.apache.james.jmap.method
 import eu.timepit.refined.auto._
 import jakarta.inject.Inject
 import org.apache.james.jmap.api.change.{CanNotCalculateChangesException, 
EmailChangeRepository, EmailChanges, State => JavaState}
+import org.apache.james.jmap.api.exception.ChangeNotFoundException
 import org.apache.james.jmap.api.model.{AccountId => JavaAccountId}
 import org.apache.james.jmap.core.CapabilityIdentifier.{CapabilityIdentifier, 
JAMES_SHARES, JMAP_MAIL}
 import org.apache.james.jmap.core.Invocation.{Arguments, MethodName}
@@ -61,6 +62,7 @@ class EmailChangesMethod @Inject()(val metricFactory: 
MetricFactory,
         processingContext = invocation.processingContext))
       .onErrorResume {
         case e: CanNotCalculateChangesException => 
SMono.just(InvocationWithContext(Invocation.error(ErrorCode.CannotCalculateChanges,
 e.getMessage, invocation.invocation.methodCallId), 
invocation.processingContext))
+        case e: ChangeNotFoundException => 
SMono.just(InvocationWithContext(Invocation.error(ErrorCode.CannotCalculateChanges,
 e.getMessage, invocation.invocation.methodCallId), 
invocation.processingContext))
         case e => SMono.error(e)
       }
 
diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxChangesMethod.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxChangesMethod.scala
index 1ab96c2c5f..482c8c6658 100644
--- 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxChangesMethod.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxChangesMethod.scala
@@ -22,6 +22,7 @@ package org.apache.james.jmap.method
 import eu.timepit.refined.auto._
 import jakarta.inject.Inject
 import org.apache.james.jmap.api.change.{CanNotCalculateChangesException, 
MailboxChangeRepository, MailboxChanges, State => JavaState}
+import org.apache.james.jmap.api.exception.ChangeNotFoundException
 import org.apache.james.jmap.api.model.{AccountId => JavaAccountId}
 import org.apache.james.jmap.core.CapabilityIdentifier.{CapabilityIdentifier, 
JMAP_MAIL}
 import org.apache.james.jmap.core.Invocation.{Arguments, MethodName}
@@ -68,6 +69,7 @@ class MailboxChangesMethod @Inject()(mailboxSerializer: 
MailboxSerializer,
         processingContext = invocation.processingContext))
       .onErrorResume {
         case e: CanNotCalculateChangesException => 
SMono.just(InvocationWithContext(Invocation.error(ErrorCode.CannotCalculateChanges,
 e.getMessage, invocation.invocation.methodCallId), 
invocation.processingContext))
+        case e: ChangeNotFoundException => 
SMono.just(InvocationWithContext(Invocation.error(ErrorCode.CannotCalculateChanges,
 e.getMessage, invocation.invocation.methodCallId), 
invocation.processingContext))
         case e => SMono.error(e)
       }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org

Reply via email to