You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2024/11/13 04:09:53 UTC
(james-project) 01/05: [ISSUE-5314] enhanced error handling for `MailboxSetUpdatePerformer`
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
commit 0c24a9021d6551e726af69e613830c6e23aea143
Author: Florent Azavant <fa...@linagora.com>
AuthorDate: Tue Nov 5 17:37:18 2024 +0100
[ISSUE-5314] enhanced error handling for `MailboxSetUpdatePerformer`
---
.../org/apache/james/jmap/method/MailboxSetUpdatePerformer.scala | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxSetUpdatePerformer.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxSetUpdatePerformer.scala
index 39c5be40db..728010bbe4 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxSetUpdatePerformer.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxSetUpdatePerformer.scala
@@ -29,7 +29,7 @@ import org.apache.james.jmap.json.MailboxSerializer
import org.apache.james.jmap.mail.{InvalidPatchException, InvalidPropertyException, InvalidUpdateException, MailboxGet, MailboxPatchObject, MailboxSetRequest, MailboxSetResponse, MailboxUpdateResponse, NameUpdate, ParentIdUpdate, ServerSetPropertyException, UnparsedMailboxId, UnsupportedPropertyUpdatedException, ValidatedMailboxPatchObject}
import org.apache.james.jmap.method.MailboxSetUpdatePerformer.{MailboxUpdateFailure, MailboxUpdateResult, MailboxUpdateResults, MailboxUpdateSuccess}
import org.apache.james.mailbox.MailboxManager.{MailboxSearchFetchType, RenameOption}
-import org.apache.james.mailbox.exception.{InsufficientRightsException, MailboxExistsException, MailboxNameException, MailboxNotFoundException}
+import org.apache.james.mailbox.exception.{DifferentDomainException, InsufficientRightsException, MailboxExistsException, MailboxNameException, MailboxNotFoundException}
import org.apache.james.mailbox.model.search.{MailboxQuery, PrefixedWildcard}
import org.apache.james.mailbox.model.{MailboxId, MailboxPath}
import org.apache.james.mailbox.{MailboxManager, MailboxSession, MessageManager, Role, SubscriptionManager}
@@ -87,6 +87,9 @@ object MailboxSetUpdatePerformer {
case e: IllegalArgumentException =>
LOGGER.info("Illegal argument in Mailbox/set update", e)
SetError.invalidArguments(SetErrorDescription(e.getMessage), None)
+ case e: DifferentDomainException =>
+ LOGGER.info("Invalid arguments in Mailbox/set update", e)
+ SetError.invalidArguments(SetErrorDescription("Invalid arguments in Mailbox/set update: different domains"), None)
case e =>
LOGGER.error("Failed to update mailbox", e)
SetError.serverFail(SetErrorDescription(e.getMessage))
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org