Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidSmilesException should be public #5

Closed
dan2097 opened this issue Jul 21, 2018 · 1 comment
Closed

InvalidSmilesException should be public #5

dan2097 opened this issue Jul 21, 2018 · 1 comment

Comments

@dan2097
Copy link

dan2097 commented Jul 21, 2018

Graph.fromSmiles throws the checked exception InvalidSmilesException, but this class is package protected which complicates catching it. Probably InvalidSmilesException should be public.
An alternative fix would be to declare Graph.fromSmiles as throwing an IOException as InvalidSmilesException extends from this.

@johnmay
Copy link
Owner

johnmay commented Jul 21, 2018

You should catch the IOException... https://github.com/cdk/cdk/blob/master/storage/smiles/src/main/java/org/openscience/cdk/smiles/SmilesParser.java#L261. I probably should have thrown that instead but since v2.0 will be out any year now I'm not going to change it since it's workable.

@johnmay johnmay closed this as completed Jul 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants