added exception handling

This commit is contained in:
2016-07-24 11:21:45 +02:00
parent 4801203378
commit f173089b14

View File

@@ -158,7 +158,7 @@ public class CSVModel {
@Override
protected List<ValidationError> call() throws Exception {
List<ValidationError> errors = new ArrayList<>();
try {
if (header != null) {
ValidationError headerError = validator.isHeaderValid(header);
if (headerError != null) {
@@ -170,7 +170,7 @@ public class CSVModel {
for (int lineNumber = 0; lineNumber < rows.size(); lineNumber++) {
CSVRow row = rows.get(lineNumber);
row.setValidator(validator);
for (String column: row.getColumns().keySet()) {
for (String column : row.getColumns().keySet()) {
CSVValue value = row.getColumns().get(column).getValue();
value.setValidator(validator);
if (validator != null) {
@@ -187,6 +187,9 @@ public class CSVModel {
}
}
}
} catch (Throwable t) {
logger.error("validation error", t);
}
return errors;
}
};