Re: Problems Handling Errors Correctly
- From: Peter Duniho <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Mon, 17 Sep 2007 01:22:45 -0700
Jonathan Wood wrote:
[...]
Yeah, the bottom line is that I don't particularly care for try...catch exceptions. It gets to where you put try...catch in every routine if you want to ensure you're program will never crash with an unhandled exception.
That's not a good idea, IMHO.
I never put exception handlers around code except when: a) I can recover gracefully from the exception and want to, and b) it's something that is known to be able to throw an exception.
If you are putting an exception handling block in every routine, you are doing WAY too much work.
Lots of methods are documented as being able to throw exceptions, but in many cases these exceptions are only thrown when you fail to call the method correctly in the first place. Rather than spending your time writing exception handling code for those methods, you should spend your time ensuring that you are calling the method correctly so that it won't throw an exception.
Pete
.
- Follow-Ups:
- Re: Problems Handling Errors Correctly
- From: Jonathan Wood
- Re: Problems Handling Errors Correctly
- References:
- Problems Handling Errors Correctly
- From: Jonathan Wood
- Re: Problems Handling Errors Correctly
- From: Peter Duniho
- Re: Problems Handling Errors Correctly
- From: Jonathan Wood
- Re: Problems Handling Errors Correctly
- From: Peter Duniho
- Re: Problems Handling Errors Correctly
- From: Jonathan Wood
- Re: Problems Handling Errors Correctly
- From: Peter Duniho
- Re: Problems Handling Errors Correctly
- From: Jonathan Wood
- Re: Problems Handling Errors Correctly
- From: Peter Duniho
- Re: Problems Handling Errors Correctly
- From: Jonathan Wood
- Re: Problems Handling Errors Correctly
- From: Peter Duniho
- Re: Problems Handling Errors Correctly
- From: Jonathan Wood
- Re: Problems Handling Errors Correctly
- From: Doug Semler
- Re: Problems Handling Errors Correctly
- From: Jonathan Wood
- Problems Handling Errors Correctly
- Prev by Date: Re: Scale a vector
- Next by Date: A challenge: regex to convert all urls within HTML
- Previous by thread: Re: Problems Handling Errors Correctly
- Next by thread: Re: Problems Handling Errors Correctly
- Index(es):
Relevant Pages
|