Re: Excessive use of IOException without proper documentation

2012-11-04 Thread Shai Erera
I think that specific exceptions should be thrown only in case we expect the user to do something with it. E.g. LockObtainException is something that I can catch and try to recover from in the code, maybe retry to obtain the lock. But all IOExceptions, maybe excluding FNFE, are unrecoverable in th

Re: Excessive use of IOException without proper documentation

2012-11-04 Thread Trejkaz
On Mon, Nov 5, 2012 at 4:25 AM, Michael-O <1983-01...@gmx.net> wrote: > Continuing my answer from above. Have you ever worked with the Spring > Framework? They apply a very nice exception translation pattern. All > internal exceptions are turned to specialized unchecked exceptions like > Authentica

Re: Excessive use of IOException without proper documentation

2012-11-04 Thread Michael-O
Shalom Shai, Am 2012-11-04 20:25, schrieb Shai Erera: Hey Mike, I'm not sure that I like the idea of throwing LuceneException or SearchException everywhere. I've been there (long time ago) and I always hated it. Not everywhere but in the top-level API would be sufficient. Some code is never

Re: Excessive use of IOException without proper documentation

2012-11-04 Thread Simon Willnauer
On Sun, Nov 4, 2012 at 8:25 PM, Shai Erera wrote: > Hey Mike, > > I'm not sure that I like the idea of throwing LuceneException or > SearchException everywhere. I've been there (long time ago) and I always > hated it. > > First, what's the difference between 'new SearchException("Failed to read >

Re: Excessive use of IOException without proper documentation

2012-11-04 Thread Shai Erera
Hey Mike, I'm not sure that I like the idea of throwing LuceneException or SearchException everywhere. I've been there (long time ago) and I always hated it. First, what's the difference between 'new SearchException("Failed to read the index", ioe)' and 'new IOException("Failed to read the index"

Re: Excessive use of IOException without proper documentation

2012-11-04 Thread Michael-O
Hi Simon, there are generally two very good resources how exceptions should be handled in Java. I will quote both: 1. Oracle's JavaDoc Style Guide: http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#throwstag 2. Joshua Bloch's book Effective Java, chapter 9: http:/

Re: Excessive use of IOException without proper documentation

2012-11-02 Thread Simon Willnauer
Hey, On Fri, Nov 2, 2012 at 2:20 PM, Michael-O <1983-01...@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 i