Error Handling
-
Hello all, I have been tasked with implementing an error handling strategy into our web app... I have decided on placing all the event logging and e-mail notification in the application_error event in the global.asax... My problem arises when I generate different types of errors... For example if I place a button on a page that does nothing but throw an error when clicked... I go into the application_error event just fine... On the other had if I place a link on the page with a URL reference to an invalid URL I sometimes (and sometimes not) get into the application_error event handler... I thought maybe there was some other error causing this event to fire... So I guess my question is this: What types of errors or exceptions trigger the application_error event and which ones do not? Thanks all Brandon
-
Hello all, I have been tasked with implementing an error handling strategy into our web app... I have decided on placing all the event logging and e-mail notification in the application_error event in the global.asax... My problem arises when I generate different types of errors... For example if I place a button on a page that does nothing but throw an error when clicked... I go into the application_error event just fine... On the other had if I place a link on the page with a URL reference to an invalid URL I sometimes (and sometimes not) get into the application_error event handler... I thought maybe there was some other error causing this event to fire... So I guess my question is this: What types of errors or exceptions trigger the application_error event and which ones do not? Thanks all Brandon
-
Hello all, I have been tasked with implementing an error handling strategy into our web app... I have decided on placing all the event logging and e-mail notification in the application_error event in the global.asax... My problem arises when I generate different types of errors... For example if I place a button on a page that does nothing but throw an error when clicked... I go into the application_error event just fine... On the other had if I place a link on the page with a URL reference to an invalid URL I sometimes (and sometimes not) get into the application_error event handler... I thought maybe there was some other error causing this event to fire... So I guess my question is this: What types of errors or exceptions trigger the application_error event and which ones do not? Thanks all Brandon
-
Right, I have been doing the research... It seems that all ASP.NET requests are handled through IIS which get directed to the aspnet_isapi.dll which then handle the error... Thanks for you insight... One more question if you dont mind... What is the rule about placing TRY/CATCH blocks in the application_error event? Thanks again for all you input... Brandon
-
Right, I have been doing the research... It seems that all ASP.NET requests are handled through IIS which get directed to the aspnet_isapi.dll which then handle the error... Thanks for you insight... One more question if you dont mind... What is the rule about placing TRY/CATCH blocks in the application_error event? Thanks again for all you input... Brandon
Hi Brandon. I'm not sure there is a rule about placing try/catch blocks in the application_error event. I think it works just like it would for any other procedure - if an exception occurs and it isn't handled in a try/catch block, it is thrown to the caller (and I think in the case of Application_Error, an exception there is just bubbled up as an unhandled exception).