Thursday, March 22, 2012

Server.GetLastError inner exception

I've got a simple Application_OnError routine set up as a generic error trap
for web applications running on IIS server (VS 2003) that logs error info and
the text of the first inner exception. I've had exceptions thrown on occasion
that have up to three additional levels of inner exceptions. Is there a way
to drill down through each of these inner exceptions (using VB.NET) to
capture and report their message? The closest example I can find using C++
code that I can't get to work in what I think would be the equivalent VB code.

tia for any help,
SueSue,

I always just write the whole exception out. ex.ToString.

That captures everything. You can't have too much information when hunting
down a bug.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Sue" <Sue@.ojd.state.or.us> wrote in message
news:C44E2FDD-A349-494A-8115-1243D0F01DF3@.microsoft.com...
> I've got a simple Application_OnError routine set up as a generic error
> trap
> for web applications running on IIS server (VS 2003) that logs error info
> and
> the text of the first inner exception. I've had exceptions thrown on
> occasion
> that have up to three additional levels of inner exceptions. Is there a
> way
> to drill down through each of these inner exceptions (using VB.NET) to
> capture and report their message? The closest example I can find using C++
> code that I can't get to work in what I think would be the equivalent VB
> code.
> tia for any help,
> Sue
Oh geez - it can't be that simple <g>!

Thanks!
Sue

"S. Justin Gengo" wrote:

> Sue,
> I always just write the whole exception out. ex.ToString.
> That captures everything. You can't have too much information when hunting
> down a bug.
> --
> Sincerely,
> S. Justin Gengo, MCP
> Web Developer / Programmer
> www.aboutfortunate.com
> "Out of chaos comes order."
> Nietzsche
> "Sue" <Sue@.ojd.state.or.us> wrote in message
> news:C44E2FDD-A349-494A-8115-1243D0F01DF3@.microsoft.com...
> > I've got a simple Application_OnError routine set up as a generic error
> > trap
> > for web applications running on IIS server (VS 2003) that logs error info
> > and
> > the text of the first inner exception. I've had exceptions thrown on
> > occasion
> > that have up to three additional levels of inner exceptions. Is there a
> > way
> > to drill down through each of these inner exceptions (using VB.NET) to
> > capture and report their message? The closest example I can find using C++
> > code that I can't get to work in what I think would be the equivalent VB
> > code.
> > tia for any help,
> > Sue
>

0 comments:

Post a Comment