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


##########
event-bus/cassandra/src/main/java/org/apache/james/events/CassandraEventDeadLettersDAO.java:
##########
@@ -104,10 +106,14 @@ private PreparedStatement 
prepareContainEventStatement(CqlSession session) {
     }
 
     Mono<Void> store(Group group, Event failedEvent, 
EventDeadLetters.InsertionId insertionId) {
+        Optional<String> maybeEvent = eventSerializer.toJson(failedEvent);
+        if (maybeEvent.isEmpty()) {
+            return Mono.error(new RuntimeException("Could not serialize event: 
" + failedEvent));
+        }

Review Comment:
   ```suggestion
           String serializedEvent = eventSerializer.toJson(failedEvent)
               .orElseThrow(() -> ...);
   ```
   
   ???



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to