Commit 658ec9cc authored by marceteau's avatar marceteau
Browse files

mise en place des messages d'erreurs corrects

parent b88b5ec5
......@@ -14,12 +14,14 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import fr.cines.Format;
import fr.cines.format.validator.FormatErrorException;
import fr.cines.format.validator.UnknownFormatException;
import fr.cines.format.validator.ValidatorBean;
import fr.gouv.vitam.common.SedaConstants;
import fr.gouv.vitam.common.json.JsonHandler;
import fr.gouv.vitam.common.logging.VitamLogger;
import fr.gouv.vitam.common.logging.VitamLoggerFactory;
import fr.gouv.vitam.common.model.IngestWorkflowConstants;
......@@ -88,8 +90,10 @@ public class FormatValidatorPlugin extends ActionHandler {
vr.setFormatId(format.getName() + "/" + format.getEncoding() + "/" + format.getVersion());
validatorResultList.add(vr);
} catch (FormatErrorException fe) {
final ObjectNode object = JsonHandler.createObjectNode();
object.put(SedaConstants.EV_DET_TECH_DATA, fe.getMessage());
itemStatus.increment(StatusCode.KO);
itemStatus.setMessage(fe.getMessage());
itemStatus.setEvDetailData(JsonHandler.unprettyPrint(object));
LOGGER.warn("Erreur lors de le validation : {}, {}", fileToValidate, fe.getMessage());
return new ItemStatus(FORMAT_VALIDATOR_PLUGIN).setItemsStatus(itemStatus.getItemId(), itemStatus);
} catch (Exception e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment