olamy commented on code in PR #33:
URL: 
https://github.com/apache/maven-build-cache-extension/pull/33#discussion_r1284156538


##########
src/main/java/org/apache/maven/buildcache/RemoteCacheRepositoryImpl.java:
##########
@@ -144,19 +145,32 @@ public void saveArtifactFile(CacheResult cacheResult, 
org.apache.maven.artifact.
      * @return null or content
      */
     @Nonnull
-    public Optional<byte[]> getResourceContent(String url) throws IOException {
+    public Optional<byte[]> getResourceContent(String url) {
+        String fullUrl = getFullUrl(url);
         try {
-            LOGGER.info("Downloading {}", getFullUrl(url));
+            LOGGER.info("Downloading {}", fullUrl);
             GetTask task = new GetTask(new URI(url));
             transporter.get(task);
             return Optional.of(task.getDataBytes());
-        } catch (Exception e) {
-            LOGGER.info("Cannot download {}", getFullUrl(url), e);
+        } catch (ResourceDoesNotExistException e) {
+            if (LOGGER.isDebugEnabled()) {
+                LOGGER.debug("Cache item not found: {}", fullUrl, e);

Review Comment:
   @gnodet there is `if (LOGGER.isDebugEnabled())` and else `info` and, more 
important without the exception as the last parameter, which is very verbose. 
per default, we will be fine. 
   But could be really more simple to remove this if and using only ` 
LOGGER.info("Cache item not found: {}", fullUrl);`



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