I have a three tier web app in which I am using MS Enterprise Library Exception Handling application block for exception management. The exceptions in the DataAccess and BusinessManagers are being logged and then replaced with a custom exception containing a general message. This custom exception is then being thrown up till the UI layer. I have defined a global exception handler in the Application_Error event in the Global.asax file from where I am planning to redirect the user to a custom error page for the user friendly error message display. In my UI event handlers I am wrapping the BusinessManager calls in a try catch block and throwing the exception hoping to catch it in the global handler. While it does get caught in the global exception handler and displays the custom error page, I am getting a debugger break in the throw statement stating that “Exception was unhandled by user code”. After this the code hits the global exception handler. Even if I remove the try catch block from the UI code, I am getting the same unhandled error message from the place where I throw the exception from the BusinessManager. I am not sure where I am going wrong.
Share
If you are running the application in debug mode, the debugger will display that window. However, if you run it in release mode it won’t appear. Nothing is wrong with your code.