@noe1995 welcome to the KNIME forum. You might be able to adapt this example with a CASE switch:
If you want to catch an error you can use a Try/Catch combination.