468,119 Members | 2,108 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,119 developers. It's quick & easy.

Determining cause of Error in VB.NET Web Apps

I'm devloping a Web Application in VB.NET. In my web.config file I have
specified that untrapped errors are to be sent to the page "errorpage.aspx".
This is working fine - if an untrapped error occurs the application is
indeed routed to this page.

On this page I would like to determine the cause of the error and either log
it in a file or send it to me via e-mail.

I am able to determine the page that sent me there from the URL parameter
"aspxerrorpath" - I would also like to be able to determine what went
wrong - or at least a line number where the failure occured.

I have the following code that I have seen in a vb.net web programming book:

dim appException as system.exception = server.getlasterror

This always returns a NULL value - no help at all!

Does anyone know how to determine the cause of an error when you have been
routed to the error page specified in the web.config file? I hope that its
possible to determine more than just the page that caused the error.

Your help would be greatly appreciated!

Fred

Nov 18 '05 #1
3 1354
Hi Fred,

Are you handling this exception in an exception handler? It sounds like
you probably aren't. In that case, you can use the
AppDomain.UnhandledException event (and all developers should be handling
this event) to get that information.

The .NET Framework documentation contains good documentation on using this
event.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Fred Nelson" <fr**@smartybird.com>
Subject: Determining cause of Error in VB.NET Web Apps
Date: Wed, 10 Dec 2003 09:53:20 -0500
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ur*************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: syr-24-58-79-218.twcny.rr.com 24.58.79.218
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!tk2msftngp13.
phx.gblXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:195539
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

I'm devloping a Web Application in VB.NET. In my web.config file I have
specified that untrapped errors are to be sent to the page "errorpage.aspx".This is working fine - if an untrapped error occurs the application is
indeed routed to this page.

On this page I would like to determine the cause of the error and either logit in a file or send it to me via e-mail.

I am able to determine the page that sent me there from the URL parameter
"aspxerrorpath" - I would also like to be able to determine what went
wrong - or at least a line number where the failure occured.

I have the following code that I have seen in a vb.net web programming book:
dim appException as system.exception = server.getlasterror

This always returns a NULL value - no help at all!

Does anyone know how to determine the cause of an error when you have been
routed to the error page specified in the web.config file? I hope that its
possible to determine more than just the page that caused the error.

Your help would be greatly appreciated!

Fred


Nov 18 '05 #2
Jim:

Thanks for your help - I'll check it out!

Fred

"Jim Cheshire [MSFT]" <ja******@online.microsoft.com> wrote in message
news:bR**************@cpmsftngxa07.phx.gbl...
Hi Fred,

Are you handling this exception in an exception handler? It sounds like
you probably aren't. In that case, you can use the
AppDomain.UnhandledException event (and all developers should be handling
this event) to get that information.

The .NET Framework documentation contains good documentation on using this
event.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Fred Nelson" <fr**@smartybird.com>
Subject: Determining cause of Error in VB.NET Web Apps
Date: Wed, 10 Dec 2003 09:53:20 -0500
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ur*************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: syr-24-58-79-218.twcny.rr.com 24.58.79.218
Path:

cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!tk2msftngp13. phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:195539X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

I'm devloping a Web Application in VB.NET. In my web.config file I have
specified that untrapped errors are to be sent to the page

"errorpage.aspx".
This is working fine - if an untrapped error occurs the application is
indeed routed to this page.

On this page I would like to determine the cause of the error and either

log
it in a file or send it to me via e-mail.

I am able to determine the page that sent me there from the URL parameter
"aspxerrorpath" - I would also like to be able to determine what went
wrong - or at least a line number where the failure occured.

I have the following code that I have seen in a vb.net web programming

book:

dim appException as system.exception = server.getlasterror

This always returns a NULL value - no help at all!

Does anyone know how to determine the cause of an error when you have beenrouted to the error page specified in the web.config file? I hope that itspossible to determine more than just the page that caused the error.

Your help would be greatly appreciated!

Fred

Nov 18 '05 #3
Fred,

Keep in mind that the ExceptionObject in the UnhandledExceptionEventArgs is
a generic Exception object.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Fred Nelson" <fr**@smartybird.com>
References: <ur*************@tk2msftngp13.phx.gbl> <bR**************@cpmsftngxa07.phx.gbl>Subject: Re: Determining cause of Error in VB.NET Web Apps
Date: Wed, 10 Dec 2003 12:34:18 -0500
Lines: 82
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <OY**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: syr-24-58-79-218.twcny.rr.com 24.58.79.218
Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!cpmsftng xa06.phx.gbl!cpmsftngxa09.
phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gblXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:195584
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Jim:

Thanks for your help - I'll check it out!

Fred

"Jim Cheshire [MSFT]" <ja******@online.microsoft.com> wrote in message
news:bR**************@cpmsftngxa07.phx.gbl...
Hi Fred,

Are you handling this exception in an exception handler? It sounds like
you probably aren't. In that case, you can use the
AppDomain.UnhandledException event (and all developers should be handling
this event) to get that information.

The .NET Framework documentation contains good documentation on using this event.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
>From: "Fred Nelson" <fr**@smartybird.com>
>Subject: Determining cause of Error in VB.NET Web Apps
>Date: Wed, 10 Dec 2003 09:53:20 -0500
>Lines: 28
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <ur*************@tk2msftngp13.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: syr-24-58-79-218.twcny.rr.com 24.58.79.218
>Path:

cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFT NGP08.phx.gbl!tk2msftngp13

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

66 posts views Thread by Darren Dale | last post: by
59 posts views Thread by kk_oop | last post: by
6 posts views Thread by Kenneth Courville | last post: by
3 posts views Thread by Wayne | last post: by
reply views Thread by Gabriel Genellina | last post: by
14 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.