logo       

FAQ fodder (Re: exceptions and distinguishing between failures and errors): msg#00108

java.junit.user

Subject: FAQ fodder (Re: exceptions and distinguishing between failures and errors)

> hi all...
>
> i've been reading some of the threads regarding testing for
> thrown exceptions, and read the wiki page http://c2.com/cgi/wiki?
> CodingJavaUnitExceptionTests. i'm wondering whether, in the face
> of exceptions (or otherwise), anyone really distinguishes between
> failures and errors.

Yes. If code throws an Exception that it shouldn't through, even under
exceptional circumstances, I treat that as an error rather than a failure.

One could argue that throwing the wrong exception type is a failure and not
an error, but since it's impossible to distinguish between simply throwing
the wrong exception type and something going horribly wrong, it is easiest to
treat them both as errors.

Mike, this is probably a FAQ. :)

--
J. B. Rainsberger,
President, Diaspar Software Services
Let's write software that people understand.
http://www.diasparsoftware.com/
telephone: +1 416 791-8603



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

News | FAQ | advertise