reta commented on code in PR #8:
URL: 
https://github.com/apache/flink-connector-opensearch/pull/8#discussion_r1104576865


##########
flink-connector-opensearch/src/main/java/org/apache/flink/connector/opensearch/sink/OpensearchWriter.java:
##########
@@ -343,7 +346,11 @@ private void extractFailures(BulkRequest request, 
BulkResponse response) {
         if (chainedFailures == null) {
             return;
         }
-        throw new FlinkRuntimeException(chainedFailures);
+        if (failureHandler == null) {

Review Comment:
   Dealing with`null` is better to be avoided: we could use the default 
`failureHandler`:
   
   ```java
   private static final FailureHandler DEFAULT_FAILURE_HANDLER = ex -> throw 
new FlinkRuntimeException(ex);
   ```
   
   and never deal with nullability / `if`s



-- 
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]

Reply via email to