Problem getting error trapping to work to trap 'file not found' for file/csv reader nodes

I have a work flow where I want to check the content of an existing csv file. Complication is that, at the first time of writing, the file would not exist. In this case it is created later on by the workflow and will thenceforth be available for checking in this way. I can think of a work around but would have liked to use error trapping to handle this gracefully and pipe in some dummy data in the case of file not found. I don't seem to be able to make this work however, the csv reader node still reports file does not exist and the execution halts at that point. I have attached a png showing a test workflow in 2 states, the first where the file did exist, and the second where I changed the name in the 'Table Creator' node to one which doesn't exist.

I tried this v2.12.2 but also just now in v3.1.1. but same issue. I also tried various combinations of the 'Try' node (variable and data) and the 'Catch'. Also, with the file reader node instead of csv reader - no luck thus far.

Can anyone offer help in how this should be configured ?



Steve Thornton

Maybe you can use an IF switch, in workflow handling?

Hey Steve,

The Try-Catch-nodes are used to catch failing nodes, this means nodes that fail in execution (you recognize them by the red circle with a white cross instead of the little traffic lights below the icon). The Reader actually fails in configuration, meaning it can't be executed and does not really fail.

Try catch is still the best nodes to use here, but you need a node that fails if the file does not exist. For example a "String to URI" node between the "Try"- and the "Table Row to Variable"-node fails if the file does not exist and triggers the catch.


Oh, OK - That follows....

Where can I find that 'String to URI' node ? It doesn't seem to be in what I have currently....

Oh sorry, of course: The "String to URI"-node is part of the KNIME File Handling-plugin. You find it in the category KNIME & Extensions.

Hi, yep I found that and installed a few other extensions also whihc look as though they will be useful.

Works a treat now with that node set to 'fail if file does not exist'.

Thanks again for your help.