Re: exception handling in event handlers
From: cody (please_dont.spam.deutronium_at_gmx.de)
Date: 04/24/04
- Next message: cody: "Re: CLR"
- Previous message: Peter Bromberg [C# MVP]: "Re: Hooking mshtm Documentl Events and Mouse going dead"
- In reply to: Sankar Nemani: "exception handling in event handlers"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 25 Apr 2004 00:47:32 +0200
> 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.
What do you mean with no unhandled exceptions? Do you have a
try{}catch(Exception) in every Eventhandler or is it simply you say that you
try to catch all Exception that are thrown by you or at least expected?
But you are right, nobody who raises an event would expect an exception,
unless you specify a specific event this way that "failing" of the event is
answered with an exception.
-- cody [Freeware, Games and Humor] www.deutronium.de.vu || www.deutronium.tk
- Next message: cody: "Re: CLR"
- Previous message: Peter Bromberg [C# MVP]: "Re: Hooking mshtm Documentl Events and Mouse going dead"
- In reply to: Sankar Nemani: "exception handling in event handlers"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|