Error handling in application_error, use session variables?

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hello,

In my handled exceptions (using try/catch), I would like to be able to log
certain variable values when an error occurs, to make debugging easier.

I'm using the sub application_error in global.asax to output to a log file
every time an error occurs. It would be easy for me to assign session
variables in my catch blocks, that are set to variable values at the time of
errors.

My question though is, is this the best way, or is there some way I can tap
into an error object and set values there to be used in global.asax.

Thanks for any help,
--Michael
 
You can get the last error object from the Server object
by Server.GetLastError().

Tu-Thach
 
Back
Top