Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / May 2004

Tip: Looking for answers? Try searching our database.

exception handling in event handlers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sankar Nemani - 22 Apr 2004 15:16 GMT
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
cody - 24 Apr 2004 23:47 GMT
>     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
[quoted text clipped - 3 lines]
> 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.

Signature

cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk

Sandeep B - 12 May 2004 06:36 GMT
The exception handling for NON GUI components can be supported using the output parameters in the components ,

tr

catch(ex

outputparam =fals

This makes sure that the exception is not propagated from NON GUI to GUI components
Also it will be better as mentioned in the earlier reply , you use specific exception handlers

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.