JMSketch setMol errors

User 0d44f06f91

17-04-2011 14:25:02

Hi,


I m using JMSketch setmol() function,


If I give this function a string which is not in smile format, for example 'ch3cooh'


I get the following alert:


java.io.FileNotFoundException: http://.../ch3cooh

    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at chemaxon.marvin.util.MolLoader.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

I wonder if there is an option in marvin to check if the string is in smiles format before I give the string as input to the


setmol function, or if there is a way to catch the alert and to give the user more informative error details


 


I m using marvin 5.3.8


Thank you very much


Ayana

ChemAxon 5433b8e56b

18-04-2011 11:41:42

Hi Ayana,


in the mentioned case the following happens: Marvin tries to recognize the file format in which the string contains the molecule, and after the applet could not recognize the format, it tries to load a resource from the server, and treat the string as the resource url. When this is also failed, it gives the error message about the resource loading failure. The recognition problem is covered since this is a default fallback mechanism.


I understand the problem with the error message. I can file a request into our issue tracker to make this message more informative, or we can create a method to validate a String against a format, or against Marvin import capabilities, and if the import fails, it can give an error message, or empty string if the given string is importable by Marvin. Which solution is more suitable for you?


Istvan

User 0d44f06f91

20-04-2011 10:40:58

Hi,


Thanks for the response


"a method to validate a String against a format, or against Marvin import capabilities" will be great and would help me a lot,


Thank you very much !

ChemAxon 5433b8e56b

21-04-2011 13:13:28

All right, we will add it soon.


We will notify you in this topic when the feature is ready.


Regards,
Istvan