Commit 34b7b4dc authored by granier's avatar granier
Browse files

Fix: traitement de UnknownFormatException

parent 52ade6a6
...@@ -96,7 +96,14 @@ public class FormatValidatorPlugin extends ActionHandler { ...@@ -96,7 +96,14 @@ public class FormatValidatorPlugin extends ActionHandler {
itemStatus.setEvDetailData(JsonHandler.unprettyPrint(object)); itemStatus.setEvDetailData(JsonHandler.unprettyPrint(object));
LOGGER.warn("Erreur lors de le validation : {}, {}", fileToValidate, fe.getMessage()); LOGGER.warn("Erreur lors de le validation : {}, {}", fileToValidate, fe.getMessage());
return new ItemStatus(FORMAT_VALIDATOR_PLUGIN).setItemsStatus(itemStatus.getItemId(), itemStatus); return new ItemStatus(FORMAT_VALIDATOR_PLUGIN).setItemsStatus(itemStatus.getItemId(), itemStatus);
} catch (Exception e) { } catch (UnknownFormatException e) {
final ObjectNode object = JsonHandler.createObjectNode();
object.put(SedaConstants.EV_DET_TECH_DATA, e.getMessage());
itemStatus.increment(StatusCode.KO);
itemStatus.setEvDetailData(JsonHandler.unprettyPrint(object));
LOGGER.warn("Impossible d'identifier le format : {}, {}", fileToValidate, e.getMessage());
return new ItemStatus(FORMAT_VALIDATOR_PLUGIN).setItemsStatus(itemStatus.getItemId(), itemStatus);
} catch (Exception e) {
LOGGER.warn("erreur lors de la validation du format" + e.getMessage()); LOGGER.warn("erreur lors de la validation du format" + e.getMessage());
} }
} }
...@@ -165,7 +172,7 @@ public class FormatValidatorPlugin extends ActionHandler { ...@@ -165,7 +172,7 @@ public class FormatValidatorPlugin extends ActionHandler {
} }
} }
protected Format validateFormat(/*final DataObject dataObject,*/ final File file) throws FormatErrorException { protected Format validateFormat(final File file) throws FormatErrorException, UnknownFormatException {
final ValidatorBean validator = new ValidatorBean(); final ValidatorBean validator = new ValidatorBean();
try { try {
...@@ -187,7 +194,7 @@ public class FormatValidatorPlugin extends ActionHandler { ...@@ -187,7 +194,7 @@ public class FormatValidatorPlugin extends ActionHandler {
} catch (final IOException e) { } catch (final IOException e) {
// throw new ValidateFormatException(depositId, e); // throw new ValidateFormatException(depositId, e);
}catch (UnknownFormatException e) { }catch (UnknownFormatException e) {
// TODO: handle exception throw 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