[Mondrian] parser Error vs. Exception
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 '
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
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.
> 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?
>> Mondrian mailing list
>> Mondrian at pentaho.org
> Mondrian mailing list
> Mondrian at pentaho.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mondrian