lucene-java-user mailing list archives

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

On Fri, Nov 2, 2012 at 2:20 PM, Michael-O <1983-01-06@gmx.net> 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
really.

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

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
core?

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
management?

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

simon
>
> Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message