Hi all,

 

before we are pushing the 0.2.0 release of Chemistry I would like to cleanup 
the exception handling in the query support package.

 

Currently some parsing errors might be hard to catch or not be thrown at all. 
Sometimes multiple errors are collected and reported at once, sometimes an 
exception is raised immediatetely. Sometime you get ANTLR exceptions  and 
sometimes you just get RuntimeExceptions.

 

My suggestion would be to follow mainly ANTLR error design:

-          Collect errors and continue parsing where possible (this appears to 
be much easier than our current attempt to throw an exception on the first 
syntax error)

-          Semantic Predicate errors use AntLR FailedPredicateException with a 
useful error message ( I first tried using our own exception class but ANTLR is 
not designed this way)

-          Have one place where we can catch all errors during query parsing 

-          an util class as an example(default impl) how to handle exceptions 
and convert them to CMIS-Exceptions.

 

This will introduce a few minor changes to the internal query API and the 
QueryUtil class will change slightly. But it will make the whole query support 
cleaner and easier to use and I can reduce code duplication.

 

If there are no objections I will proceed and perform the changes during the 
next days. If someone has issues with this please raise your hand....

 

Jens

 

Reply via email to