You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Jens Hübel <jh...@opentext.com> on 2010/11/23 17:02:04 UTC

Query exception cleanup in opencmis

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

 


Re: Query exception cleanup in opencmis

Posted by Florent Guillaume <fg...@nuxeo.com>.
Looks good.

Florent


On Tue, Nov 23, 2010 at 5:02 PM, Jens Hübel <jh...@opentext.com> wrote:
> 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
>
>
>
>



-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87