Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.commonjava.service.promote.model.StoreKey;
import org.commonjava.service.promote.util.ContentDigest;
import org.commonjava.service.promote.util.ResponseHelper;
import org.commonjava.service.promote.validate.PromotionValidationException;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -88,6 +89,12 @@ public String digest(StoreKey key, String path, ContentDigest digest) throws Exc
logger.debug("Retrieve failed, {}:{}, code: {}", key, path, resp.getStatus());
}
}
catch ( Exception e )
{
logger.debug("Retrieve and calculate checksum failed, {}:{}, Exception: {}", key, path, e.getMessage());
throw new PromotionValidationException(
"Retrieve and calculate checksum failed for " + key + ":" + path, e);
}

return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,14 @@ public PromotionValidationException(String s, Exception e, String ruleName) {
public PromotionValidationException(String s) {
super(s);
}

@Override
public String toString() {
String baseMessage = super.toString();
Throwable cause = getCause();
if (cause != null && cause.getMessage() != null) {
return baseMessage + " [Cause: " + cause.getMessage() + "]";
}
return baseMessage;
}
}