Error handling in application_error, use session variables?

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
 
T

Tu-Thach

You can get the last error object from the Server object
by Server.GetLastError().

Tu-Thach
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top