You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hop.apache.org by GitBox <gi...@apache.org> on 2022/05/13 10:47:42 UTC

[GitHub] [hop] hansva commented on a diff in pull request #1486: [HOP-3938] - Safely call methods for PipelineResult

hansva commented on code in PR #1486:
URL: https://github.com/apache/hop/pull/1486#discussion_r872256133


##########
plugins/engines/beam/src/main/java/org/apache/hop/beam/engines/BeamPipelineEngine.java:
##########
@@ -1532,4 +1537,19 @@ public void setBeamEngineRunConfiguration(
       IBeamPipelineEngineRunConfiguration beamEngineRunConfiguration) {
     this.beamEngineRunConfiguration = beamEngineRunConfiguration;
   }
+
+  private <R> R safelyCall(ThrowingSupplier<R> supplier) {
+    return safelyCall(supplier, null);
+  }
+
+  private <R> R safelyCall(ThrowingSupplier<R> supplier, R defaultValue) {
+    try {
+      return supplier.get();
+    } catch (UnsupportedOperationException e) {
+      logChannel.logBasic(e.getMessage());

Review Comment:
   use logChannel.logError()



-- 
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: commits-unsubscribe@hop.apache.org

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