473,421 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 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 1609
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.