Application_Error in Global.asax Doesn't Fire

gtzbest

New Member
Locally the application error executes fine(catches errors then puts it into a database or sends it via mail). But when I add it up to our website it doesn't execute the codes under application_error.Any help why it doesn't fire?\[code\]Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) Dim cookie As HttpCookie = Current.Request.Cookies("id") Dim Code As HttpCookie = Current.Request.Cookies("code") Dim ErrorMsg() As String If cookie Is Nothing Then Else Dim cDBConnection As clsDBConnection = New clsDBConnection(GetConnection, enumEgswFetchType.DataReader) If IsNothing(Code.Value) Then ErrorMsg = {0, Request.UserHostAddress.ToString, Me.Session.SessionID, Context.Request.RawUrl, Date.Now, Server.GetLastError.GetBaseException.Message, Server.GetLastError.GetBaseException.GetType.ToString, Server.GetLastError.GetBaseException.Data.ToString, Server.GetLastError.GetBaseException.Source, Server.GetLastError.GetBaseException.TargetSite.ToString, Server.GetLastError.GetBaseException.StackTrace} cDBConnection.InsertErrorLog(ErrorMsg(0), ErrorMsg(1), ErrorMsg(2), ErrorMsg(3), ErrorMsg(4), ErrorMsg(5), ErrorMsg(6), ErrorMsg(7), ErrorMsg(8), ErrorMsg(9), ErrorMsg(10)) Response.Redirect("~/Error.aspx") Else ErrorMsg = {Code.Value, Request.UserHostAddress.ToString, cookie.Value, Context.Request.RawUrl, Date.Now, Server.GetLastError.GetBaseException.Message, Server.GetLastError.GetBaseException.GetType.ToString, Server.GetLastError.GetBaseException.Data.ToString, Server.GetLastError.GetBaseException.Source, Server.GetLastError.GetBaseException.TargetSite.ToString, Server.GetLastError.GetBaseException.StackTrace} cDBConnection.InsertErrorLog(ErrorMsg(0), ErrorMsg(1), ErrorMsg(2), ErrorMsg(3), ErrorMsg(4), ErrorMsg(5), ErrorMsg(6), ErrorMsg(7), ErrorMsg(8), ErrorMsg(9), ErrorMsg(10)) Response.Redirect("~/Error.aspx") End If 'End If End IfEnd Sub\[/code\]
 
Back
Top