# Catch WARN

**URL:** <https://forum.knime.com/t/catch-warn/26436>\
**Category:** KNIME Analytics Platform\
**Created:** [September 1, 2020, 10:23am UTC](https://forum.knime.com/t/catch-warn/26436 "2020-09-01T10:23:08Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![joel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://forum.knime.com/u/joel)\
**Post date:** [September 1, 2020, 10:23am UTC](https://forum.knime.com/t/catch-warn/26436/1 "2020-09-01T10:23:08Z")

</div>

Hi Knimers,

I would like to know if it is feasible to catch WARN message which are printed in the console in the KNIME Analytics platform.

I tried to use the try/catch and the Active Branch Inverter nodes but I was not able to catch the WARN message only the ERROR ones.

Do you have any suggestions ?

Regards,  
Joel

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [September 1, 2020, 10:30am UTC](https://forum.knime.com/t/catch-warn/26436/2 "2020-09-01T10:30:22Z")

</div>

Hello @joel,

try/catch won’t catch warning messages from Console. Is there a warning which stops workflow execution and you would like to catch it or you simply want to have all warnings from certain workflow on one place for documentation/analysis?

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![joel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://forum.knime.com/u/joel)\
**Post date:** [September 1, 2020, 11:27am UTC](https://forum.knime.com/t/catch-warn/26436/3 "2020-09-01T11:27:33Z")

</div>

Hi @ipazin

I am using a chemaxon to convert molfile (string object ) into molfile (mol object).

The node cannot convert some structures, because the mol content is not correct and displays as a warning message in the console the reason (for example Unknown S-group type “END”).

So I wanted to get this message and attached it to the dataset in order to know why the conversion is not possible.

Regards,  
Joel

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [September 1, 2020, 1:52pm UTC](https://forum.knime.com/t/catch-warn/26436/4 "2020-09-01T13:52:19Z")

</div>

Hi @joel,

I see but I’m not familiar with this extension. Does node executes successfully or fails upon configuration with warning message?

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![joel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://forum.knime.com/u/joel)\
**Post date:** [September 1, 2020, 2:28pm UTC](https://forum.knime.com/t/catch-warn/26436/5 "2020-09-01T14:28:42Z")

</div>

It executes without error but it generates a warning message if the conversion fails.

So I got warning messages that contains the reason attached to the row IDs, like a java snippet when you try to make an operation on an empty cell (null value).

Joel

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [September 2, 2020, 10:28am UTC](https://forum.knime.com/t/catch-warn/26436/6 "2020-09-02T10:28:06Z")

</div>

Hi @joel,

in that case don’t know a way to catch warning messages from Console. Wondering what would be preferred/best way to have these messages? KNIME table? What you can try is to parse KNIME log where this message is written. Basically you can use File Reader to read log file and [Rule-based Row Filter](https://kni.me/n/Q-yW-3C9DumtInuz) to have only warning messages from certain node in your table.  
Example: `$Col0$ LIKE "*WARN*" AND $Col0$ LIKE "*String To Number*" => TRUE`

Still if you need to do additional processing based on conversion outcome you need to implement this logic in your KNIME workflow.

Hope this helps!

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![joel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://forum.knime.com/u/joel)\
**Post date:** [September 2, 2020, 1:33pm UTC](https://forum.knime.com/t/catch-warn/26436/7 "2020-09-02T13:33:38Z")

</div>

Hi @ipazin,

Thanks for your feedback.

I am a litle bit concern by your solution because this workflow is executed either on the Analytics platform or on the server (scheduled job).  
So I don’t know if you solution will work on the server or only on the Analytics platform?

Regards,  
Joel

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [September 2, 2020, 10:06pm UTC](https://forum.knime.com/t/catch-warn/26436/8 "2020-09-02T22:06:49Z")

</div>

What you could try is active workflow based logs, increase the Log Level and read the log back in.

![image](https://forum-cdn.knime.com/uploads/default/original/3X/f/d/fd10e8680cdcb47132a8ceec88b696042f5f0576.png)

It might be necessary to either catch a start time of your workflow and only consider the entries newer than that or delete the file at each start.

---

<div class="post-metadata">

**Author:** ![joel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://forum.knime.com/u/joel)\
**Post date:** [September 3, 2020, 8:28am UTC](https://forum.knime.com/t/catch-warn/26436/9 "2020-09-03T08:28:07Z")

</div>

Hi @mlauber71

I will try your suggestion, thanks.

@ipazin, Do you think that it could be possible to catch those warnings directly using a Knime node in the next releases?

Regards,  
Joel

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [September 3, 2020, 8:46am UTC](https://forum.knime.com/t/catch-warn/26436/10 "2020-09-03T08:46:19Z")

</div>

Hi @joel,

> [@joel](#):
>
> So I don’t know if you solution will work on the server or only on the Analytics platform?

I see. I’m not sure either how this should work. Probably you need logic to determine if you run workflow on Server or Desktop and then read proper log.

> [@joel](#):
>
> Do you think that it could be possible to catch those warnings directly using a Knime node in the next releases?

Think this should be addressed somehow. Is (new) node a way to do it? Again not sure.

Anyways let me think/check with someone about it a bit more and will get back to topic.

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [September 3, 2020, 10:12am UTC](https://forum.knime.com/t/catch-warn/26436/11 "2020-09-03T10:12:12Z")

</div>

I once built a workflow to do a meta search in KNIME’s XML files. Maybe you can derive some inspiration from there.

> [@Search a Node in a Knime Workflow by Id (Goto & focus a Node by ID)](https://forum.knime.com/t/search-a-node-in-a-knime-workflow-by-id-goto-focus-a-node-by-id/14495/12):
>
> You could still try to adapt some ‘dirty’ metasearch approaches:

---

<div class="post-metadata">

**Author:** ![joel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://forum.knime.com/u/joel)\
**Post date:** [September 7, 2020, 2:37pm UTC](https://forum.knime.com/t/catch-warn/26436/12 "2020-09-07T14:37:57Z")

</div>

Hi @mlauber71

I checked the “enable per workflow logs” and then parsed the workflow log to get the warn message and it worked.  
I mean, I was able to attach the warn message of the log file to the incorrect structure using the row ID.

Now I have to test this solution on the server.

Thanks @mlauber for your advices.

Regards,  
Joel

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [September 8, 2020, 4:15pm UTC](https://forum.knime.com/t/catch-warn/26436/13 "2020-09-08T16:15:53Z")

</div>

> [@joel](#):
>
> I checked the “enable per workflow logs” and then parsed the workflow log to get the warn message and it worked.

great it worked! If you have finished the parsing of the local log with the WARNING maybe you could undertake it to make a working sample to upload to the hub so others could benefit from your insights and the solution. Thank you.

---

<div class="post-metadata">

**Author:** ![joel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://forum.knime.com/u/joel)\
**Post date:** [September 10, 2020, 6:56am UTC](https://forum.knime.com/t/catch-warn/26436/14 "2020-09-10T06:56:52Z")

</div>

Hi

For your information this solution works also on the server.

Joel

---

<div class="post-metadata">

**Author:** ![joel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://forum.knime.com/u/joel)\
**Post date:** [September 10, 2020, 8:05am UTC](https://forum.knime.com/t/catch-warn/26436/15 "2020-09-10T08:05:18Z")

</div>

The pasing of the log works for the node “Advanced MolConverter” of the chemaxon extension, but it will not work for other nodes since the log message is node related.

So I am not sure that it is a relvant to share what I did since it works only for a node of this extension.

Regards,

Joel

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [March 11, 2021, 8:05pm UTC](https://forum.knime.com/t/catch-warn/26436/16 "2021-03-11T20:05:40Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
