Permalink
Browse files

Updated SMARTS parser JJT file, to drop the use of CDKException when …

…a invalid SMARTS is provided.
  • Loading branch information...
1 parent dfb3e86 commit 1ef89fb07b3f6003baa0d7253f7221f79cb72158 @rajarshi rajarshi committed May 24, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/org/openscience/cdk/smiles/smarts/parser/SMARTSParser.jjt
@@ -82,7 +82,7 @@ public class SMARTSParser {
* This method parses a Smarts String and returns an instance of
* <code>QueryAtomContainer</code>
*/
- public static QueryAtomContainer parse(String smarts) throws CDKException {
+ public static QueryAtomContainer parse(String smarts) {
QueryAtomContainer container = null;
StringReader reader = new StringReader(smarts);
try {
@@ -92,7 +92,7 @@ public class SMARTSParser {
= new org.openscience.cdk.smiles.smarts.parser.visitor.SmartsQueryVisitor();
container = (QueryAtomContainer)start.jjtAccept(visitor, null);
} catch (ParseException exception) {
- throw new CDKException("The string " + smarts + " is not a valid" +
+ throw new IllegalArgumentException("The string " + smarts + " is not a valid" +
" SMARTS string: " + exception.getMessage(), exception);
}
return container;

0 comments on commit 1ef89fb

Please sign in to comment.