T
tshad
I have my error handling set up in Global.asax:
Sub Application_Error(Sender As Object, E as EventArgs)
In this procedure I call a function in a dll that will write out to a
history file.
This works for some errors, but not others. If it doesn't work, it stops
there and the normal MS error page goes to the User.
For example:
I have the following error:
***************************************************
Compiler Error Message: BC30684: 'DataSet' is a type and cannot be used as
an expression.
Source Error:
Line 65: Dim parameters() As SqlParameter
Line 66:
Line 67: DataSet = myDbObject.RunProcedure("GetScheduleNames", parameters,
"HistoryLog")
Line 68: HistoryLogGrid.DataSource = ds
Line 69: HistoryLogGrid.DataBind()
********************************************************
I know why I got the error, but I would have expected my Global error
handler to handle it.
But it doesn't.
The reason it doesn't handle it is because of this code:
if not HttpContext.Current.Session.SessionID is nothing then
parameters(0).value = HttpContext.Current.Session.SessionID
else
parameters(0).value = ""
end if
If I even reference "HttpContext.Current.Session.SessionID", it dies.
I assume that is because this is an error where ASP is checking the page for
errors before actually handling it and there is no SessionID. If it was a
logic error, this works fine and I can access the SessionID in my Global
error routine.
Why can't I here????
Or at least check if it exists.
I need to find out how to handle this or my Global Error routine is not
going to work.
Thanks,
Tom
Sub Application_Error(Sender As Object, E as EventArgs)
In this procedure I call a function in a dll that will write out to a
history file.
This works for some errors, but not others. If it doesn't work, it stops
there and the normal MS error page goes to the User.
For example:
I have the following error:
***************************************************
Compiler Error Message: BC30684: 'DataSet' is a type and cannot be used as
an expression.
Source Error:
Line 65: Dim parameters() As SqlParameter
Line 66:
Line 67: DataSet = myDbObject.RunProcedure("GetScheduleNames", parameters,
"HistoryLog")
Line 68: HistoryLogGrid.DataSource = ds
Line 69: HistoryLogGrid.DataBind()
********************************************************
I know why I got the error, but I would have expected my Global error
handler to handle it.
But it doesn't.
The reason it doesn't handle it is because of this code:
if not HttpContext.Current.Session.SessionID is nothing then
parameters(0).value = HttpContext.Current.Session.SessionID
else
parameters(0).value = ""
end if
If I even reference "HttpContext.Current.Session.SessionID", it dies.
I assume that is because this is an error where ASP is checking the page for
errors before actually handling it and there is no SessionID. If it was a
logic error, this works fine and I can access the SessionID in my Global
error routine.
Why can't I here????
Or at least check if it exists.
I need to find out how to handle this or my Global Error routine is not
going to work.
Thanks,
Tom