Skip to content

Commit

Permalink
Merge pull request #13 from embulk/fix-exception-handling-with-older
Browse files Browse the repository at this point in the history
Fix Exception handling to be the same with older embulk-parser-csv
  • Loading branch information
dmikurube authored Nov 18, 2023
2 parents 022e387 + 40b530a commit 959cedb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/org/embulk/parser/csv/CsvParserPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,9 @@ public void run(TaskSource taskSource, final Schema schema,
}
}

try {
if (!tokenizer.nextRecord()) {
// empty file
continue;
}
} catch (final InvalidCsvFormatException ex) {
throw new DataException(ex);
if (!tokenizer.nextRecord()) {
// empty file
continue;
}

while (true) {
Expand Down Expand Up @@ -473,6 +469,8 @@ private String nextColumn() {
}

pageBuilder.finish();
} catch (final InvalidCsvFormatException ex) {
throw new DataException(ex);
}
}

Expand Down

0 comments on commit 959cedb

Please sign in to comment.