mirror of
https://github.com/frosch95/SmartCSV.fx.git
synced 2026-04-11 13:38:23 +02:00
added exception handling
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user