In our asp.net code for the site, we handle the error raised in couple of different places as explained below.
1. Every function in the code behind file (
.aspx.vb or
.aspx.cs) I have a
Try..Catch functionality.
2. In the Catch section of the
Try..Catch, the HandleError function in errorhandler.
vb class is called. This function gets parameter of Exception type.
3. HandleError function has code which redirects to error.aspx where the user friendly message is displayed and actual error is logged into the event log.
4. If the error is not trapped here, I have a code inside Application_Error function in global.asax.
vb which does the same thing (redirect to error.aspx).
In both situations, I log the status of the response along with the actual error description (Response.Status). The problem here is: since the error logging is done inside the error.aspx page, I get the Reponse.Status inside that page as "
200-OK" which means no error occured. Is there a way of getting the status of response object where the error occured.