|
distinguishing between failures and errors: msg#00109java.junit.user
<jbr> > 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. </jbr> i think it depends on the exception. if a method has advertised an exception in its throws clause, a caller can anticipate that it could happen, catch it, and call the outcome a failure. any other "unanticipated" exception would then be an error. but in practice, it probably doesn't matter whether the throwing of the wrong "advertised" exception should signal failure or error. i was trying to use the exception example as a starting point for discussion about whether failure/error distinctions in junit are meaningful to anyone. my experience has been that they are not-- in either case, failure or error, you're led in the direction of a solution. what do you all think? this, too, the failure/error distinction and whether it matters, may be a good FAQ item too? thanks in advance for the enlightenment. cheers, p
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | FAQ fodder (Re: exceptions and distinguishing between failures and errors), J. B. Rainsberger |
|---|---|
| Next by Date: | Re: distinguishing between failures and errors, Francois Beausoleil |
| Previous by Thread: | FAQ fodder (Re: exceptions and distinguishing between failures and errors), J. B. Rainsberger |
| Next by Thread: | Re: distinguishing between failures and errors, Francois Beausoleil |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |