alexthomasmc commented on code in PR #33:
URL:
https://github.com/apache/maven-build-cache-extension/pull/33#discussion_r1162909727
##########
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:
```suggestion
LOGGER.error( "Cannot download cache item: {}", getFullUrl( url
), e );
```
Can I suggest that if we get here it should be at least a warning regardless
of whether debug is enabled.
I'd go for error() as the remote cache can be easily disabled if it is known
that it's not available.
--
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]