Paul,

If you have an unhandled exception in any thread, after executing the
AppDomain.UnhandledException, that particular thread will get killed. So if
you have an unhandled exception in main thread, your application will crash.


If you are talking about windows application I suggest you also look into,
Application.ThreadException event. You can use this event to handle all the
thread exception risen from the windows procedure (so exception is not
unhandled anymore).  Your thread does not get killed and control continues
to execute. But AFAIK, you can not handle exception risen from the worker
threads using this event. In those scenario, you may want to bank on
AppDomain.UnhandledException. Anyway, once a worker thread rises exception,
you may not mind to kill it. If you do, then handle the exception.

Rathna Raj
Icode

 -----Original Message-----
From:   Nick Wienholt [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, June 04, 2002 1:31 PM
To:     [EMAIL PROTECTED]
Subject:        Re: [DOTNET] Handling Unhandled Exceptions

Try the AppDomain.UnhandledException Event

Nick

----- Original Message -----
From: "Paul Stevens" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 04, 2002 5:20 PM
Subject: [DOTNET] Handling Unhandled Exceptions


> Is there a way to capture all unhandled exceptions in my code ie a
> centralized exception handling function for all exceptions I did not
handle
> specifically ?
>
>
>
> Paul Stevens
> Senior Developer
> Resolution Technology Group
> Cellular: * +27 (0) 82 413 3171
> Phone:   *    +27 (0) 12 665 4620
> Fax:        *    +27 (0) 12 665 4619
> Mail:       *    [EMAIL PROTECTED]
>
>
>
> Privileged/Confidential information may be contained in this message. If
you
> are not the addressee indicated in this message (or responsible for
delivery
> of the message to such person), you may not copy or deliver this message
to
> anyone. In such case, you should destroy this message, and notify us
> immediately. If you or your employer does not consent to Internet email
> messages of this kind, please advise us immediately. Opinions, conclusions
> and other information expressed in this message are not given or endorsed
by
> our firm or employer unless otherwise indicated by an authorized
> representative independent of this message.
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to