ExceptionEvent.getCause() returns Throwable. Why ?

Marc-André Laverdière marcandre.laverdiere at gmail.com
Thu Jul 15 04:59:24 EDT 2010


Well...  Exception won't capture RuntimeException or Error.

You might want to catch runtime exceptions too... things like
ArrayIndexOutOfBoundsExceptions, NullPointerException and all.
So the only way to do that, and catch your normal exceptions like
IOException and others, is to catch Throwable.

Marc-André LAVERDIÈRE
"Perseverance must finish its work so that you may be mature and
complete, not lacking anything." -James 1:4
mlaverd.theunixplace.com/blog

 /"\
 \ /    ASCII Ribbon Campaign
  X      against HTML e-mail
 / \



2010/7/15 Tchoum <happytchoum at hotmail.com>:
>
> Hi,
>
> Why ExceptionEvent.getCause() returns Throwable instead of Exception ? Isn't
> it a bit risky to catch Throwable expecially in the case of OutOfMemoryError
> ?
>
> Thank you,
>
> PL
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/ExceptionEvent-getCause-returns-Throwable-Why-tp5295752p5295752.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>



More information about the netty-users mailing list