Error handling
try {
Object numList = strsList.stream()
.map( new ToInteger() )
.sorted( new ReverseCase() )
.collect( Collectors.toList() );
get( Fields.Out, "reverseOrder" ).setValue( row, numList.toString() );
} catch (NumberFormatException ex) {
// Number List contains a value that cannot be converteds to an Integer.
rowInError = true;
errMsg = ex.getMessage();
errCnt = errCnt + 1;
}
if ( !rowInError ) {
putRow( data.outputRowMeta, row );
} else {
// Output errors to the error hop. Right click on step and choose "Error Handling..."
putError(data.outputRowMeta, row, errCnt, errMsg, "Not allowed", "DEC_0");
}Last updated
Was this helpful?

