lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <>
Subject Re: Excessive use of IOException without proper documentation
Date Fri, 02 Nov 2012 21:27:08 GMT

On Fri, Nov 2, 2012 at 2:20 PM, Michael-O <> wrote:
> Hi,
> why does virtually every method (exaggerating) throw an IOE? I know there might be a
failure in the underlying IO (corrupt files, passing checked exc up, etc) but
> 1. Almost none of the has a JavaDoc on it

what should the javadoc say? I mean it would repeat itself all the time no?

> 2. Throwing an IOE from most of the methods doesn't really help. You cannot create separate
catch blocks. You have to rip your code apart in tens of try catch blocks.
> Here is a simple example: Both IndexSearcher#search and IndexSearcher#doc throw an IOE
with any further documentation. I don't have the chance to detect where the exception has
happened nor I can pass something reasonable back to the user. And both methods are keypoints
in Lucene.

can you elaborate what you would change to make this easier digestible
for you? I mean specialized exceptions class would be a mess here

> E.g., there are exceptions thrown in IndexSearcher without any message. Simply empty

I agree we should fix them. I already committed some fixes to
IndexSearcher. Can you come up with a patch that fixes some more in

running grep -R "new.*Exception()" * | wc -l

yields 82 in core so there is room for improvement.

> Lucene 4.0 received a complete API overhaul. Why was no action taken to clean up exception

I'd really like to hear what you have in mind. can you elaborate?

> Mike
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message