Exceptions in Global.asax

C

cliff

Hello,
I'm using the Application_Error event to process unhandled exceptions. But,
I'm wondering what to do with exceptions that may occur in the Global.asax
file itself. For example, I have code in the Session_Start event that may
throw an exception, but I'm not sure what to do.

** Should I put a try/catch/finally block in the Session_Start event? If
so, what would the catch block contain?
** Or, should I not use a try/catch/finally block at all in the
Session_Start event?
** Or???????

Thanks for the help.
 
A

Alvin Bruney [MVP - ASP.NET]

i'm not sure why you are throwing in session_start. you are at the top level
and exceptions at that level will bring down the appdomain. i mean you
could - depending on severity - or you can use a try catch block to call
session end or some more graceful approach

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
 

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

Top