Skip to content

Commit 0cfccd1

Browse files
author
Dai MIKURUBE
committed
Change InvalidCsvFormatException and InvalidCsvQuotationException to inherit RuntimeException directly
1 parent e6e3d0d commit 0cfccd1

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

embulk-parser-csv/src/main/java/org/embulk/parser/csv/CsvParserPlugin.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,13 @@ public void run(TaskSource taskSource, final Schema schema,
334334
}
335335
}
336336

337-
if (!tokenizer.nextRecord()) {
338-
// empty file
339-
continue;
337+
try {
338+
if (!tokenizer.nextRecord()) {
339+
// empty file
340+
continue;
341+
}
342+
} catch (final InvalidCsvFormatException ex) {
343+
throw new DataException(ex);
340344
}
341345

342346
while (true) {

embulk-parser-csv/src/main/java/org/embulk/parser/csv/InvalidCsvFormatException.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
package org.embulk.parser.csv;
1818

19-
import org.embulk.spi.DataException;
20-
21-
public class InvalidCsvFormatException extends DataException {
19+
public abstract class InvalidCsvFormatException extends RuntimeException {
2220
public InvalidCsvFormatException(final String message) {
2321
super(message);
2422
}

embulk-parser-csv/src/main/java/org/embulk/parser/csv/InvalidCsvQuotationException.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
package org.embulk.parser.csv;
1818

19-
import org.embulk.spi.DataException;
20-
21-
public class InvalidCsvQuotationException extends DataException {
19+
public abstract class InvalidCsvQuotationException extends RuntimeException {
2220
public InvalidCsvQuotationException(final String message) {
2321
super(message);
2422
}

0 commit comments

Comments
 (0)