Last post Oct 07, 2010 01:48 PM by grundebar
Oct 07, 2010 01:02 PM|sunny43|LINK
I need some help regarding one issue I am facing. I created a httpmodule for hadling the unhandled errors and I need to log those errors using log 4 net in database.
Everting working fine but I am not getting any error information once the error was hadled and I need that info too. I want to make it as a centralize module which can trap all errors and log those errors.
How call application_error event of httpmodule from catch block...so that I can log that info there and I no need log in every catch block..
asp .net 4.0
centralized error module
Oct 07, 2010 01:48 PM|grundebar|LINK
Once you have handled an error in a catch block, it no longer exists in the current context. If you log an error at any level lower than the application, the application_error event will never fire. You can throw the exception in your catch block to let
the error pass back up the chain once you have logged it and it will eventually hit the appliation_error event. The application_error event is meant to catch unhandled errors.