use of org.knime.base.node.io.filereader.FileReaderException in project knime-core by knime.
the class FixedWidthRowIterator method prepareForException.
/*
* !!!!!!!!!! Creates the exception object (storing the last read items in
* the row of the exception), sets the global "exception thrown" flag, and
* closes the input stream. !!!!!!!!!!
*/
private FileReaderException prepareForException(final String msg, final int lineNumber, final String rowHeader, final DataCell[] cellsRead) {
/*
* indicate we have thrown (actually will throw...) an exception, and
* close the stream as we will not read anymore from the stream after
* the exception.
*/
m_exceptionThrown = true;
DataCell[] errCells = new DataCell[cellsRead.length];
System.arraycopy(cellsRead, 0, errCells, 0, errCells.length);
for (int c = 0; c < errCells.length; c++) {
if (errCells[c] == null) {
errCells[c] = DataType.getMissingCell();
}
}
String errRowHeader = "ERROR_ROW (" + rowHeader.toString() + ")";
DataRow errRow = new DefaultRow(errRowHeader, errCells);
return new FileReaderException(msg, errRow, lineNumber);
}
Aggregations