1

In my Application the exception handling was not done in a proper way.

so need to implement the exception handling using "Application_Error" Event. Here the problem is that the event is not getting triggered in some cases. The scenarios in which this happens are not specific.

Any one can help me out in this. What can be done to trigger this event?

Oded
  • 489,969
  • 99
  • 883
  • 1,009
Anjana
  • 1,447
  • 5
  • 23
  • 33
  • Not at all clear what you are asking about expand more – Developer Mar 03 '11 at 11:53
  • 1
    "exception handling was not done in a proper way" - Please explain how it _was_ done, with a code sample if possible. Without knowing what was done wrongly, we can't help. – Oded Mar 03 '11 at 11:53
  • What type of application it is a Web or Windows application – Developer Mar 03 '11 at 11:54
  • Do you have an example of which errors do not trigger it? – Richard Friend Mar 03 '11 at 11:58
  • Its web application. Try and catch has not been used for about 80% of the Application. So now its high time to rewrite the whole code. Thats y i opted for "Application_Error" Event for unhandled exceptions. – Anjana Mar 05 '11 at 06:17

2 Answers2

2

You are using global page for catching the error...and it will trigger only for unhandled exceptions so check for try catch blocks and if there is case like that then throw exception.

tinu
  • 168
  • 1
  • 3
  • 9
0

If you are running a multi-threaded app then this might help

        AppDomain currentDomain = AppDomain.CurrentDomain;
        currentDomain.UnhandledException +=
            (s, args) =>
                {
                    Debugger.Break();
                };
  • Thanks Mr Craig for the response. If the application is not multithreaded. Also where should we add this code snippet ? – Anjana Mar 03 '11 at 12:42