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?
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.
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).
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 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.
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?
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.
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.
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.
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.
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.