All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.polyglotted.eswrapper.services.IndexerException Maven / Gradle / Ivy

package io.polyglotted.eswrapper.services;

import com.google.common.collect.ImmutableMap;
import io.polyglotted.eswrapper.indexing.IndexKey;

import java.util.Map;

@SuppressWarnings("serial")
public final class IndexerException extends RuntimeException {
    public final ImmutableMap errorsMap;

    public IndexerException(Map errorsMap) {
        super(buildFailureMessage(errorsMap));
        this.errorsMap = ImmutableMap.copyOf(errorsMap);
    }

    private static String buildFailureMessage(Map errorsMap) {
        StringBuilder sb = new StringBuilder();
        sb.append("indexing failed:");
        for (Map.Entry entry : errorsMap.entrySet())
            sb.append("\n[").append(entry.getKey()).append("]: ").append(entry.getValue());
        return sb.toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy