coursierapi.error.DownloadingArtifactsError Maven / Gradle / Ivy
package coursierapi.error;
import java.util.HashMap;
import java.util.Map;
public class DownloadingArtifactsError extends FetchError {
private final Map errors;
private DownloadingArtifactsError(Map errors, String message) {
super(message);
this.errors = new HashMap<>(errors);
}
public static DownloadingArtifactsError of(Map errors) {
StringBuilder b = new StringBuilder();
for (Map.Entry entry : errors.entrySet()) {
b.append(entry.getKey());
b.append(": ");
b.append(entry.getValue());
b.append('\n');
}
return new DownloadingArtifactsError(errors, b.toString());
}
public Map getErrors() {
return errors;
}
}