Exception handling in WinForms

My current project involves Windows Forms and all my previous experience involves WebForms. One thing I am wondering on Windows Forms is, why don't we have very broad error handling options in Windows Forms as WebForms. For example, we can trap error in ASP.NET in hierarchical way.

1. By using Try Catch in local routines.

2. By using Page_Error event

3. By using Global.asax error events

4. By redirecting control to specific pages depending on each specific error(like HTTP 400 and 500 specific errors) in Web.config file.

Of course, if we use Try Catch Finally in the main form which branches the control to different forms, all the unhandled exceptions can be captured. It is my wishful thinking that we should be able to control the unhandled exceptions in App.config file :)

No Comments