Open manuelschwarze opened 3 years ago
You might be able to do this more quickly than you think. In Eclipse, if you use a Java Search for 'message' on Methods as shown then you will find everywhere you use the legacy method and need to modify:
If you only want the exception message then replaceing e.message()
with new RDKitRuntimeExceptionHandler(e).getMessage()
is enough
Steve Roughley, Vernalis, has suggested the following interesting idea as it was successfully implemented already in the Vernalis nodes:
In the spirit of OSS/sharing etc I thought that this latest commit to the Vernalis code might be of interest:
https://github.com/vernalis/vernalis-knime-nodes/commit/ebc1d9f0dfd2d54c4ae67e29e40eb00117069f7c
In particular this file - https://github.com/vernalis/vernalis-knime-nodes/blob/master/com.vernalis.knime.chem.core/src/com/vernalis/knime/chem/rdkit/RDKitRuntimeExceptionHandler.java
Basically this provides a mechanism for handling RDKit exceptions for either the new (4.1) or older versions of the RDKit Types plugin. Typical usage:
Hope that’s of use… Steve
I think this is a very good idea, but would require some amount of refactoring as we have to go through all RDKit nodes code and rework the error handling and automated tests - that would be a looong journey.
Steve had some other idea: Maybe we can make the #getMessage() work in the wrappers in RDKit – that would solve the problem for once and all. Then we can simply rely on having a meaningful message in all exceptions coming from RDKit.
If I understand it correctly, that would mean to improve the SWIG mechanism that creates the wrapper classes... - It will be more on the RDKit side, not so much on the RDKit Nodes side.