Icon

kn_​forum_​38402_​try_​catch_​loop_​error_​and_​continue

Catch an error in an optimization loop and continue (Forum 38402)

Catch an error in an optimization loop and continue (Forum 38402)

The important points are:

- encapsulate your loop in a component. Otherwise KNIME seems to have a problem to identify the Try-Catch block

- provide an empty table with the same structure as the one you want to collect at the end of a loop. I think you also could just use one table with one column and allow changing data structures in your Loop-End (you might have to clean that up later)

- I have not fully worked out the use of the error messages. In this case it just checks which ID ‘made’ it thru and would list the ones who did not



save the empty structure once Catch an error in an optimization loop and continue (Forum 38402) Node 660OUTERSTARTNode 712Node 726Node 727Node 745Node 746START of Error catchingIdentifizerungsnummer999 to cause an errordeliberately entera number 999 that will faildummy_structure.tableNode 1035dummy_structure.tableto provide the Catch Errornode with an "alternative" END ERRORcatchingwith optimizationloop insidesee which ID numbers failedOUTERSTOP RowID Table Row ToVariable Loop Start DuplicateRow Filter Column Filter Numeric Scorer Past Table Future Table Try (VariablePorts) Table Creator Concatenate Table Writer Rule-basedRow Filter Table Reader Catch Errors(Data Ports) Component GroupBy ReferenceRow Filter Loop End save the empty structure once Catch an error in an optimization loop and continue (Forum 38402) Node 660OUTERSTARTNode 712Node 726Node 727Node 745Node 746START of Error catchingIdentifizerungsnummer999 to cause an errordeliberately entera number 999 that will faildummy_structure.tableNode 1035dummy_structure.tableto provide the Catch Errornode with an "alternative" END ERRORcatchingwith optimizationloop insidesee which ID numbers failedOUTERSTOPRowID Table Row ToVariable Loop Start DuplicateRow Filter Column Filter Numeric Scorer Past Table Future Table Try (VariablePorts) Table Creator Concatenate Table Writer Rule-basedRow Filter Table Reader Catch Errors(Data Ports) Component GroupBy ReferenceRow Filter Loop End

Nodes

Extensions

Links