Are aware of the seminal book "Effective Java" by Joshua Bloch which
devotes an entire chapter to Java exceptions?

/Casper

On 15 Aug., 02:31, Hannu Leinonen <hlein...@gmail.com> wrote:
> Hello posse (of The Posse)!
>
> I've been lately discussing about exception handling in Java with my
> workmates. And I've noticed that there's some uncertainty about
> Exceptions and how to use them. Currently we're working on a quite
> traditional three-tier Spring+Hibernate web app (using way too much of
> that disgusting null programming, but that's another story).
>
> Personally I usually regard ... catch (Exception e) ... as a code smell
> because it will catch - usually unintentionally - all RuntimeExceptions
> too. Not to mention catching Throwable, like there was a lot we could do
> with Errors. My current style is catching all checked exceptions on
> their own blocks and catching RuntimeException on it's own block where
> it makes sense (at least in controllers). But that sometimes makes the
> code ugly with a dozen catch blocks doing exactly the same thing. AFAIK
> Project Coin is going to fix this annoyance. Would it be better in a
> situation where I anyways catch RuntimeException to use Exception as it
> is the lowest common denominator?
>
> How do you make the most out of your Exceptions? And how do you do it in
> multi-tier architecture?
>
> Best Regards,
> Hannu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to