You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/11/01 16:11:22 UTC

[GitHub] [james-project] chibenwa commented on a diff in pull request #1275: JAMES-3830 Implement JMAP Quota/changes

chibenwa commented on code in PR #1275:
URL: https://github.com/apache/james-project/pull/1275#discussion_r1010618137


##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MDNSendMethod.scala:
##########
@@ -104,10 +104,8 @@ class MDNSendMethod @Inject()(serializer: MDNSerializer,
       })
 
   override def getRequest(mailboxSession: MailboxSession, invocation: Invocation): Either[Exception, MDNSendRequest] =
-    serializer.deserializeMDNSendRequest(invocation.arguments.value) match {
-      case JsSuccess(mdnSendRequest, _) => mdnSendRequest.validate
-      case errors: JsError => Left(new IllegalArgumentException(Json.stringify(ResponseSerializer.serialize(errors))))
-    }
+    serializer.deserializeMDNSendRequest(invocation.arguments.value)
+      .asEither.left.map(ResponseSerializer.asException)

Review Comment:
   ```suggestion
       serializer.deserializeMDNSendRequest(invocation.arguments.value)
         .asEither
         .flatMap(_.validate)
         .left.map(ResponseSerializer.asException)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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