I used to have logging and email alerts of unhandled errors go right
from the Application_Error event. But much of the stuff I wanted to log
was in the current session state and if I referred to that from this
event I'd get an exception("Not available in this context"). Same for
the Session_End event.
I've addressed the Application_Error issue by doing a Server.Transfer to
my custom error handler and deal with the error over there. Seems to
work most of the time but every now and then I get a Null reference
exception on the Server.Transfer("error.aspx?src=AE") line.
I know at least some of these exceptions come from the Session_End
event. I also used to do some cleanup there based on what is in the
current session. So I tried the same trick
(Server.Transfer("error.aspx?src=SE")but always get a Null reference
exception on that line.
Anyone know why?
How to other people work around this?
Thanks!
Matt