I built a Component that creates helpful, custom Error Messages when a Request Node fails. I did this with the help of a Breakpoint Node. Now I wanted to put this Component in a Try-Catch Enclosure and forward a default answer if the Request failed. Somehow whith a failing Request the Compont fails and outputs the Error Message but the Try-Catch Block won’t forwar the default Table. I don’t really know why this behaviour occurs. I’m using Knime Version 6.4.3. Sadly I’m unable to update to the newest version of Knime. Maybe this Issue is dependent on the Version but I’m unable to test that and I can’t use a newer version anyway.
I hope someone here might know a thing and could help me out.
Hi @erikBarthelmann -
Two things for you to think about (I wouldn’t classify either of them as “solutions”):
- Move the Breakpoint node outside of the component
- Convert the component to a metanode
Both will allow execution of the Catch Errors node in the bottom branch, but I also don’t fully understand what you’re wanting to do so these ideas may not work for other reasons.
Thanks for your reply.
I have built a few components for my colleagues to use. Those components communicate with a server via HTTP requests. Sometimes those calls can fail for several reasons. I wanted to create a component that:
- Checks the return code of the HTTP request
- Terminates the component if the request returns an error code
- Prints a custom message explaining the error with maybe additional info how to resolve the error
This way I could easily resuse the “ResponseCheck” component and print the custom messages to the console for the users of my actual components.
So the “ResponseCheck” component is actually used inside other components.
“ResponseCheck” is a component because this way i can specify the error messag that will be shown with a certain error code in the configuration menu of the component instead of changing the metanode in every instance.
I hope this helped clear things up a bit.
Maybe I am thinking to complicated and this is not a reasonable approach with a solution.
This should work if you move your try catch in the component
I am not aware of another solution