Re: Eclipse not display warning if try catch is not present
- From: "Jason Cavett" <jason.cavett@xxxxxxxxx>
- Date: 5 Apr 2007 09:50:11 -0700
On Apr 5, 12:37 pm, "Oliver Wong" <o...@xxxxxxxxxxxxxx> wrote:
"Uwe Plonus" <s...@xxxxxxx> wrote in message
news:ev35tf$9v1$1@xxxxxxxxxxxx
Jason Cavett wrote:
...and...from what I've learned about RuntimeExceptions, you shouldn't
really catch them anyway. If you're getting a RuntimeException you
have a deeper problem that needs fixed.
Which is not true for HibernateException. In former versions of
hibernate it was not a RuntimeException. I don't know exactly why they
changed that but in the case of a HibernateException there are many ways
to continue.
Also other RuntimeExceptions are worth catching. Often you have the
possibility to continue.
Another thing are Errors. They are not worth of catching because you
can't do anything useful in case of an Error.
Unless, of course, the people at Hibernate decide to change
HibernateException so that it no longer subclasses (Runtime)Exception, but
Error instead. In which case, you should catch that error, as there *is*
something useful you can do with it.
In other words, forget the dogma. Catch an throwable if it makes sense
to do so, and don't catch it if it doesn't make sense to do so.
- Oliver- Hide quoted text -
- Show quoted text -
Good advice. Thanks.
.
- References:
- Eclipse not display warning if try catch is not present
- From: Mirror
- Re: Eclipse not display warning if try catch is not present
- From: usenetuser
- Re: Eclipse not display warning if try catch is not present
- From: Jason Cavett
- Re: Eclipse not display warning if try catch is not present
- From: Uwe Plonus
- Re: Eclipse not display warning if try catch is not present
- From: Oliver Wong
- Eclipse not display warning if try catch is not present
- Prev by Date: Re: String[] to String
- Next by Date: Re: Schrodinger's regular expression
- Previous by thread: Re: Eclipse not display warning if try catch is not present
- Next by thread: Problem with browser tabs and sessions
- Index(es):
Relevant Pages
|