alexthomasmc commented on code in PR #33:
URL:
https://github.com/apache/maven-build-cache-extension/pull/33#discussion_r1176228909
##########
src/main/java/org/apache/maven/buildcache/RemoteCacheRepositoryImpl.java:
##########
@@ -165,9 +166,28 @@ public Optional<byte[]> getResourceContent( String url )
throws IOException
transporter.get( task );
return Optional.of( task.getDataBytes() );
}
+ catch ( ResourceDoesNotExistException e )
+ {
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Cache item not found: {}", getFullUrl( url ), e
);
+ }
+ else
+ {
+ LOGGER.info( "Cache item not found: {}", getFullUrl( url ) );
+ }
+ return Optional.empty();
+ }
catch ( Exception e )
{
- LOGGER.info( "Cannot download {}", getFullUrl( url ), e );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Cannot download cache item {}", getFullUrl( url
), e );
+ }
+ else
+ {
+ LOGGER.error( "Cannot download cache item {}: {}", getFullUrl(
url ), e );
+ }
Review Comment:
Yes that's the scenario I had in mind, i.e. enabling the remote cache is a
deliberate act so if it then doesn't work that should be an error not a warning.
In the situation where the user doesn't expect the remote cache to work,
e.g. working offline, they should disable it.
--
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]