[Mondrian] parser Error vs. Exception

Paul Stoellberger p.stoellberger at gmail.com
Thu Mar 29 14:28:59 EDT 2012


Unfortunately it is not.

if you create invalid mdx like:

with member Measures.Test as '
select
from Sales

It will throw an Error like:
 mondrian.parser.TokenMgrError: Lexical error at line 4, column 0.  Encountered: <EOF> after : "\'\nselect\nfrom Sales\n"
I've added catch Error now to my execution exception handling, that fixes it for me, but maybe we should wrap it in Mondrian as well and throw an exception instead

-Paul


On Mar 29, 2012, at 8:13 PM, Julian Hyde wrote:

> I agree that we shouldn't be using Error for everyday occurrences such as syntax errors in MDX. Errors are for unrecoverable system issues such as OutOfMemory.
> 
> The TokenMgrError class is generated by JavaCC. We didn't have a choice. But I believe that it is handled each time it is thrown.
> 
> Julian
> 
> On Mar 29, 2012, at 4:32 AM, Paul Stoellberger wrote:
> 
>> I just encountered a parser Exception that would throw a TokenMgrError, and I was wondering why you would use Error instead of Exception?
>> It kinda messes up my exception handling a bit (which I can adapt, but just wondered why you chose Error over Exception)
>> 
>> And is there any other point where you chose Error over Exception that I need to be aware of?
>> 
>> -Paul
>> 
>> _______________________________________________
>> Mondrian mailing list
>> Mondrian at pentaho.org
>> http://lists.pentaho.org/mailman/listinfo/mondrian
> 
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20120329/8b232ab6/attachment.html 


More information about the Mondrian mailing list