[
https://issues.apache.org/jira/browse/LUCENE-6965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15088234#comment-15088234
]
Uwe Schindler commented on LUCENE-6965:
---------------------------------------
Instead of the runtime exception as cause, it is much better to simply replace
the stack trace of the ParseException by the private runtime one:
{code:java}
exception.initCause(e);
// gets:
exception.setStackTrace(e.getStackTrace());
{code}
By that it looks like the Exception was thrown from the visitor and the
internal private exception is completely hidden.
I did the same in MMapDirectory to convert wrong OOM because mmap failed to
IOEx.
> Expression's JavascriptCompiler to throw ParseExceptions with bad function
> names or arity
> -----------------------------------------------------------------------------------------
>
> Key: LUCENE-6965
> URL: https://issues.apache.org/jira/browse/LUCENE-6965
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Tomás Fernández Löbbe
> Attachments: LUCENE-6965.patch, LUCENE-6965.patch
>
>
> Currently JavascriptCompiler will throw IllegalArgumentException for bad
> function names (or functions that don't exist) and for bad arity. I can see
> why this was done this way, but I believe ParseException would also be
> correct and it would be better since that's the exception clients will be
> prepared to receive.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]