logo       

Re: distinguishing between failures and errors: msg#00129

java.junit.user

Subject: Re: distinguishing between failures and errors

--- In junit@xxxx, Eric Heikkila <ericheikkila@xxxx> wrote:

> Fear (of my coworkers or even sometimes of myself)
> makes me tend to use checked versus unchecked
> exceptions.
>
In my experience those same untrustworthy coworkers are the ones
who when forced to handle a checked exception will write:

catch(Exception e){}

Apart from making refactoring harder, checked exceptions also
make exception handling code more error prone. These are things
I have seen frequently where developers write code to handle checked
exceptions:

o Do nothing
o Print/log message (but not the stacktrace)
o Wrap the exception but lose the cause exception and it's stacktrace
o catch Exception (also catches all those RuntimeExceptions they
had forgotten about

--
Neil Swingler




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise