Re: How to force the program to continue after unhandled exception detection
- From: nano2k <adrian.rotaru@xxxxxxxxxxx>
- Date: Sat, 8 Mar 2008 00:33:58 -0800 (PST)
On 8 Mar, 02:07, "Peter Duniho" <NpOeStPe...@xxxxxxxxxxxxxxxx> wrote:
On Fri, 07 Mar 2008 14:11:27 -0800, nano2k <adrian.rot...@xxxxxxxxxxx>
wrote:
[...]
On this point, I'm stucked. Can't get rid of exception helper, even if
I want the exception to be handled by the general exception handler I
defined.
There's a fundamental mistake in your assumptions. That is, you have not
actually defined a "general exception handler".
You've defined a handler for the ThreadException _event_, but that's
entirely different. It doesn't handle an exception, it handles the event
that's raised when an exception _isn't_ handled.
If you want the exception to be handled, you need to handle it. With a
try/catch block, not an event handler.
Pete
You're right, I made a mistake. I handled an event, that's right.
But the question remains. I want to get rid of exception helper and
let this event handler deal with the exception.
I have tons of places where exception handling is necessary and the
handler looks like: "If an unhadled exception raises, than simply
display its message and continue running!". Why should I write _the
same_ code each time?
Of course, there are also many many cases where I need to handle
specific types of exceptions and take the appropriate measures. I'm
not talking about these ones.
But in modern exception handling approach, implementing a general
exception catching mechanism is a _must_.
The only problem is that I get stucked in VSNET2005 when such an
"unhandled" exception occurs.
.
- Follow-Ups:
- References:
- Prev by Date: Re: threading question
- Next by Date: Re: How to force the program to continue after unhandled exception detection
- Previous by thread: Re: How to force the program to continue after unhandled exception detection
- Next by thread: Re: How to force the program to continue after unhandled exception detection
- Index(es):
Relevant Pages
|