exception handling in event handlers

From: Sankar Nemani (snemani_at_nospamlumedx.com)
Date: 04/22/04


Date: Thu, 22 Apr 2004 07:16:16 -0700

Hi
    In our organization, we made a decision to not have any unhandled
exceptions inside event handler methods. If we didn't do this, one event
handler's unhandled exceptions will stop other event handlers from getting
called. We use the same approach for both UI and non-UI eventhandlers. In UI
eventhandlers we let the user know by popping up a msgbox while in non-UI
event handlers, we just log the exception.
Any thoughts to better the design are welcome.
Sankar Nemani



Relevant Pages

  • Re: overload lock command? maybe others?
    ... I can't see how this would apply to try/catch. ... You pass the code as an anonymous delegate as an ... I typically implement my event handlers inside anonymous delegates ... Application.ThreadException - for exceptions thrown during Windows ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is there a technique for global error trap?
    ... Although those event handlers are sharing the same stack as other procedures ... exceptions are not normally propagated back through the event dispatcher. ... > the Application object can handle (although I still recommend error ...
    (microsoft.public.vb.general.discussion)
  • Re: Exception not catched in right place
    ... the way that exceptions work can sometimes be counterintuitive when ... and the exceptions should work the way that you expect ... calls to event handlers ... stack dumps that show your method being called directly from the ...
    (microsoft.public.dotnet.languages.csharp)