This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 0495d5b976f camel-jbang - Log ERROR if failing to download depedencies 
as this can otherwise cause endless looping.
0495d5b976f is described below

commit 0495d5b976f6dc75ba6a72bc907a779a6e324ccd
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Wed Jun 8 07:30:56 2022 +0200

    camel-jbang - Log ERROR if failing to download depedencies as this can 
otherwise cause endless looping.
---
 .../src/main/java/org/apache/camel/main/DownloadThreadPool.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloadThreadPool.java
 
b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloadThreadPool.java
index da621a190f7..6c05046ef40 100644
--- 
a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloadThreadPool.java
+++ 
b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloadThreadPool.java
@@ -20,6 +20,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 
 import org.apache.camel.util.StopWatch;
 import org.apache.camel.util.TimeUtils;
@@ -44,8 +45,11 @@ class DownloadThreadPool {
             try {
                 future.get(5000, TimeUnit.MILLISECONDS);
                 done = true;
+            } catch (TimeoutException e) {
+                // not done
             } catch (Exception e) {
-                // not complete
+                log.error("Error downloading: " + gav + " due: " + 
e.getMessage());
+                return;
             }
             if (!done) {
                 log.info("Downloading: {} (elapsed: {})", gav, 
TimeUtils.printDuration(watch.taken()));

Reply via email to