Exceptions: How to make sure... 2006-11-01 - By Mike New
Back > Hi list, how make sure I can handle (catch) every exception that a > statement > may throw; I mean, I can add: > > // proof code > } catch (Exception anyException) { > // handle it generically > } > > But what I really want to know is how many and which are the exceptions > that > a statement may throw...thanks in advance
I use Eclipse. Comment out the above catch, put in a finally{}, and Eclipse will tell you what exceptions you need to catch.
By the way, if you want to be really sure you're catching everything, even runtime exceptions such as NullPointerException, use Throwable instead of Exception in your above code....
Mike > > =========================================================================== > To unsubscribe, send email to listserv@(protected) and include in the > body > of the message "signoff J2EE-INTEREST". For general help, send email to > listserv@(protected) and include in the body of the message "help". >
-- ---- ---- ------ _/ /// // -- ---- ---- ---- --
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|