Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do I catch unhandled exceptions

Reply
Thread Tools

How do I catch unhandled exceptions

 
 
Alan Silver
Guest
Posts: n/a
 
      03-20-2006
Hello,

One of my web sites seems to throw the occasional exception in a place
where I don't expect it. I know I should expect them anywhere, but just
supposing I've missed one, is there a way of having some sort of global
catch-all that will allow me to log the error and present the user with
some friendly message?

TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
 
tdavisjr
Guest
Posts: n/a
 
      03-20-2006
The Global.asax has an event called Applictions.OnError, you retreive
the last exception by using Server.GetLastError and log that exception
in this event.

 
Reply With Quote
 
 
 
 
Alan Silver
Guest
Posts: n/a
 
      03-20-2006
In article <(E-Mail Removed). com>,
tdavisjr <(E-Mail Removed)> writes
>The Global.asax has an event called Applictions.OnError, you retreive
>the last exception by using Server.GetLastError and log that exception
>in this event.


Thanks very much.

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
Alan Silver
Guest
Posts: n/a
 
      03-22-2006
In article <(E-Mail Removed). com>,
tdavisjr <(E-Mail Removed)> writes
>The Global.asax has an event called Applictions.OnError, you retreive
>the last exception by using Server.GetLastError and log that exception
>in this event.


OK, I looked into this a bit more, and it seems I can't really get much
interesting information, such as what page generated the error and what
it was doing. The stack trace is very generic and doesn't really help me
at all.

Is there any way to get more info in this event? Even knowing which page
was being executed would be a start, but ideally I would like more than
that. TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
tdavisjr
Guest
Posts: n/a
 
      03-22-2006
Oh. On the Exception object look at the InnerException and print the
stack trace for that. It will give detailed information. I forgot to
mention this.

 
Reply With Quote
 
Alan Silver
Guest
Posts: n/a
 
      03-23-2006
In article <(E-Mail Removed) .com>,
tdavisjr <(E-Mail Removed)> writes
>Oh. On the Exception object look at the InnerException and print the
>stack trace for that. It will give detailed information. I forgot to
>mention this.


Thanks, I'll see if that is any more enlightening

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
an unhandled win32 exception was unhandled occurred in inetinfo.exe Warren Tang ASP .Net 1 09-23-2008 03:01 PM
How do I catch unhandled Exceptions in Webservice (2.0) Tomasz ASP .Net Web Services 4 01-23-2007 12:49 PM
Unhandled Exceptions thrown Winista ASP .Net 0 03-22-2006 08:02 PM
Unhandled Exceptions - ASP.Net tberry@vhb.com ASP .Net 1 03-07-2006 10:41 PM
Unhandled Exceptions & Framesets terry ASP .Net 5 07-03-2003 04:20 PM



Advertisments