472,976 Members | 1,224 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,976 software developers and data experts.

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 1582
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
59
by: kk_oop | last post by:
Hi. I wanted to use exceptions to handle error conditions in my code. I think doing that is useful, as it helps to separate "go" paths from error paths. However, a coding guideline has been...
6
by: Kenneth Courville | last post by:
Hello, I'm looking for assistance with the Access object model. I know this is VB, but I'm building an Office Add-using C# directed at Access 2002. I'm literate in VB, so you can reply in VB... I...
3
by: Wayne | last post by:
I am wondering if it is at all possible to ascertain what cause the PostBack event to occur? Currently I have a DropDownList and 2 Radio buttons that cause a PB (this may change to 2 Buttons if...
1
by: daniel | last post by:
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...
23
by: PW | last post by:
Hi, I'd like to close a recordset and set the database to nothing if a recordset is open if an error has occured. Leaving a recordset open and a database open isn't a good idea, right? ...
5
by: evenlater | last post by:
I know how to determine the file location of the current Access database in VBA. But I'm trying to figure out how to determine the file location of my back-end. Anybody know how I can call up the...
53
by: Aaron Gray | last post by:
Due to M$'s stupidity in not making DOMElements first class citizens the following will not work :- function isElement( o) { return o instanceof Element } It works for FF, Opera and Safari.
0
by: Gabriel Genellina | last post by:
En Sun, 21 Sep 2008 19:42:10 -0300, Blubaugh, David A. <dblubaugh@belcan.comescribió: Below there is a transcript of a compile session. I've used a somewhat old version of mingw and g77, scipy...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.