diff --git a/common/source/java/ch/systemsx/cisd/common/parser/ExcelRowTokenizer.java b/common/source/java/ch/systemsx/cisd/common/parser/ExcelRowTokenizer.java index 5be83b61689fae57e11e556fbc792c19a3fa896a..5f7450f1470a23e3ef59167957931d5a9ff99576 100644 --- a/common/source/java/ch/systemsx/cisd/common/parser/ExcelRowTokenizer.java +++ b/common/source/java/ch/systemsx/cisd/common/parser/ExcelRowTokenizer.java @@ -31,7 +31,7 @@ public class ExcelRowTokenizer implements ILineTokenizer<Row> { } - public String[] tokenize(Row row) + public String[] tokenize(Row row) throws ParsingException { return tokenizeRow(row); } @@ -48,7 +48,7 @@ public class ExcelRowTokenizer implements ILineTokenizer<Row> return line; } - private static String extractCellValue(Cell cell) + private static String extractCellValue(Cell cell) throws ParsingException { switch (cell.getCellType()) { @@ -65,11 +65,13 @@ public class ExcelRowTokenizer implements ILineTokenizer<Row> "Excel formulas are not supported but one was found in cell " + extractCellPosition(cell)); case Cell.CELL_TYPE_ERROR: - throw new UserFailureException("There is an error in cell " - + extractCellPosition(cell)); + throw new ParsingException(new String[] + { "There is an error in cell " + extractCellPosition(cell) }, + cell.getRowIndex()); default: - throw new UserFailureException("Unknown data type of cell " - + extractCellPosition(cell)); + throw new ParsingException(new String[] + { "Unknown data type of cell " + extractCellPosition(cell) }, + cell.getRowIndex()); } } diff --git a/common/source/java/ch/systemsx/cisd/common/parser/ILineTokenizer.java b/common/source/java/ch/systemsx/cisd/common/parser/ILineTokenizer.java index 91b7f82d5045e07255cfec0bebba2f42d2015213..5999199923fd42b846b547b60e92d570aa46e8ed 100644 --- a/common/source/java/ch/systemsx/cisd/common/parser/ILineTokenizer.java +++ b/common/source/java/ch/systemsx/cisd/common/parser/ILineTokenizer.java @@ -34,7 +34,7 @@ public interface ILineTokenizer<T> public void init(); /** Splits given <code>line</code> into an array of tokens. */ - public String[] tokenize(T line); + public String[] tokenize(T line) throws ParsingException; /** * Cleans up resources used by this <code>ILineTokenizer</code>.