Error Handling for Excel Reader - send email if node failed

#1

Hi guys,

I am new to KNIME and currently I am trying to find out how to implement a proper error handling for my data manipulation flows.

This is what I want to do:

  • Read Excel File
  • Data Manipulation
  • Export CSV File
  • if Success, then send email with success message
  • if Error (e.g. Read Excel failed, because no file available), then send email with error message

I played around with Try Catch nodes but I really have no clou how to configure and use them correctly. In my mind the flow should look something like this but propably it is nonsense:
image

Can someone help me? How to configre the flow, that error message email is sent, if Excel Reader fails.

0 Likes

#2

Hi there @NicerDicer ,

welcome to KNIME Community Forum!

You are on the right direction so here are couple of things that can help you make this work:

  • Try/Catch sequence will catch errors only during node execution meaning error like one you mentioned before (file not available in Excel Reader node) will not be caught cause it happens during node configuration
  • to somehow catch that file is missing and report it one can use String to URI or File Meta Info node. Both of them have option Fail if file does not exist which occurs during execution
  • Try (Variable Ports) needs input so use String Configuration node for example. In it you can write your successful message
  • See this example from KNIME Hub. It contains whole process plus logic after Catch Errors node

Try it out and if any questions/comments feel free to ask.

Happy KNIMEing!

Br,
Ivan

4 Likes

#3

Thanks for your input @ipazin

Now my workflow looks like this:

Checking if the file exists works very well with File Meta Info.
But I am still struggling with the Catch Node.
When I execute the workflow, the Fail Node is always active, also if there was no error (see screenshot).

Best Dominik

0 Likes

#4

Hi @NicerDicer,
if you take a look at the node description in the AP or on the Hub you can see that the ports of the Catch Errors node do not work like you expect them to:

Output Ports

  1. Type: Flowvariable: Original input or default if execution failed.
  2. Type: Flowvariable: Reasons for Failure (if any).

You need to add an if switch that reacts to the default flow variable and enables the send email node

best,
Gabriel

0 Likes

#5

Hi there @NicerDicer,

just to add on @gab1one answer. In example linked in my first reply you can find logic (in Metanode after Catch Errors node) that determines if there was error or not. Try to make it work and if still have problems I can make you an example workflow to check.

Br,
Ivan

0 Likes