bkkothari2255 opened a new pull request, #38:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/38

   Issue: SLING-13376
   
   When an artifact download fails, `ArtifactProvider.getArtifact()` catches 
all exceptions internally and returns `null`. As a result, 
`ArtifactManager.getArtifactHandler()` swallows the underlying root cause (e.g. 
HTTP 401/403, 404, or connection timeouts) and only throws a generic 
`IOException: Artifact <url> not found in any repository` without any 
diagnostic detail
   
   
   - Extending `ArtifactProvider` SPI:
     - Added `default URL getArtifactFile(String url, String relativeCachePath) 
throws IOException` so providers can propagate network/HTTP errors instead of 
returning `null`
     - Bumped `org.apache.sling.feature.io.artifacts.spi` package version to 
`1.1.0`
     - backward-compatible: existing implementations inheriting `getArtifact()` 
continue to work
     
   - Updating `DefaultArtifactHandler`:
     - Implemented `getArtifactFile()` without swallowing network errors
     - Captures exact HTTP status code and message (`HTTP 401 Unauthorized`, 
`HTTP 404 Not Found`, etc.) or connection failure
     
   - Enriching `ArtifactManager.getArtifactHandler()`:
     - Collects exceptions per repository URL
     - If resolution fails across all repositories, formats an `IOException` 
detailing each repository's failure and attaches all causes as suppressed 
exceptions (`addSuppressed()`)
     
   - Tests:
     - Added unit test in `ArtifactManagerTest` verifying multi-repository 
error reporting


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