You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "drhaozhong (via GitHub)" <gi...@apache.org> on 2023/04/23 02:38:54 UTC
[GitHub] [lucene] drhaozhong opened a new issue, #12240: queryparse throws different exceptions when clone() fails
drhaozhong opened a new issue, #12240:
URL: https://github.com/apache/lucene/issues/12240
### Description
I find that my code fails to handle the failures of clones, when clones happen in queryparser.
I notice that lucene hides CloneNotSupportedException, and throws RuntimeException. For example, CharArrayIterator has the following code:
`public CharArrayIterator clone() {
try {
return (CharArrayIterator) super.clone();
} catch (CloneNotSupportedException e) {
// CharacterIterator does not allow you to throw CloneNotSupported
throw new RuntimeException(e);
}
}`
Due to the above observation, my code catches RuntimeException, and analyzes its embedded CloneNotSupportedException, when it needs to handle the failures of clones.
However, when I start to call queryparser, I find it does not hide CloneNotSupportedException. As a result, my code fails to catch failed clones when calling queryparser.
Will lucene fix the problem? If not, I will have to update all my handling code.
### Version and environment details
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org