[Mondrian] parser Error vs. Exception

Julian Hyde jhyde at pentaho.com
Thu Mar 29 15:47:42 EDT 2012


Can't reproduce this on 3.4. Trying both the Mondrian legacy API and olap4j, and several MDX queries. Please log a bug with the MDX you are using and the full stack you receive.

On Mar 29, 2012, at 11:28 AM, Paul Stoellberger wrote:

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<mailto:Mondrian at pentaho.org>
http://lists.pentaho.org/mailman/listinfo/mondrian

_______________________________________________
Mondrian mailing list
Mondrian at pentaho.org<mailto:Mondrian at pentaho.org>
http://lists.pentaho.org/mailman/listinfo/mondrian

_______________________________________________
Mondrian mailing list
Mondrian at pentaho.org<mailto: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/fd604480/attachment-0001.html 


More information about the Mondrian mailing list