You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by an...@apache.org on 2020/01/29 22:32:40 UTC

[sling-org-apache-sling-feature-io] branch master updated: SLING-9038 - Catch File Not Found Exception and only report it as trace message as it might be resolved later in another try

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

andysch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-io.git


The following commit(s) were added to refs/heads/master by this push:
     new c01b6d6  SLING-9038 - Catch File Not Found Exception and only report it as trace message as it might be resolved later in another try
c01b6d6 is described below

commit c01b6d6f5826c3f3a4870f189e912e96d0776017
Author: Andreas Schaefer <sc...@iMac.local>
AuthorDate: Wed Jan 29 14:32:17 2020 -0800

    SLING-9038 - Catch File Not Found Exception and only report it as trace message as it might be resolved later in another try
---
 .../java/org/apache/sling/feature/io/artifacts/ArtifactManager.java  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/main/java/org/apache/sling/feature/io/artifacts/ArtifactManager.java b/src/main/java/org/apache/sling/feature/io/artifacts/ArtifactManager.java
index 5767c3b..0d91332 100644
--- a/src/main/java/org/apache/sling/feature/io/artifacts/ArtifactManager.java
+++ b/src/main/java/org/apache/sling/feature/io/artifacts/ArtifactManager.java
@@ -18,6 +18,7 @@ package org.apache.sling.feature.io.artifacts;
 
 import java.io.BufferedReader;
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -365,6 +366,10 @@ public class ArtifactManager implements AutoCloseable {
                     this.config.incCachedArtifacts();
                 }
                 return cacheFile.toURI().toURL();
+            } catch ( final FileNotFoundException e) {
+                logger.trace("File not found here (keep on looking): '{}'", url);
+                // Do not report if the file does not exist as we cycle through the various sources
+                return null;
             } catch ( final Exception e) {
                 logger.info("Artifact not found in one repository", e);
                 // ignore for now