473,387 Members | 1,540 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,387 software developers and data experts.

Err object VS. GetLastError()

The original programmer of our website put "on error resume next" on
every page to cover up his lack of skill. Many of our pages are
returning errors that we never see.

I want to make a little script that emails me at the occurance of an
error. I copied one that used the Err object but I don't want to use
it because I would like line numbers is the email.

I then copied our custom 500 error page that uses the GetLastError
function but it always seems to be empty, like no error occurred.

The function "If Err Then" returns true so the Err object sees the
error. Why won't GetLastError return the error.
Jul 22 '05 #1
1 1798
GetLastError can *only* be used within the custom 500 error handler, which
will only be called if an error actually gets bubbled up to the caller. You
cannot capture it if you bypass the error using on error resume next -- this
still allows you to handle the error yourself, which defeats the purpose of
the 500 handler. It'd be nice to be able to circumvent it, of course, but
that's nothow it's designed...

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Nick Messick" <nm******@gmail.com> wrote in message
news:63**************************@posting.google.c om...
The original programmer of our website put "on error resume next" on
every page to cover up his lack of skill. Many of our pages are
returning errors that we never see.

I want to make a little script that emails me at the occurance of an
error. I copied one that used the Err object but I don't want to use
it because I would like line numbers is the email.

I then copied our custom 500 error page that uses the GetLastError
function but it always seems to be empty, like no error occurred.

The function "If Err Then" returns true so the Err object sees the
error. Why won't GetLastError return the error.

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dev | last post by:
Hi all, Win2k IIS5 I am trying to capture some information about 404 errors occurring on our website. I have defined a custom error page in IIS5 using the properties of the site. I am creating...
1
by: SilverlineDesign | last post by:
I am having trouble using Server.GetLastError() on my asp.net pages. I defines a standard error page in my web.config to handle all site errors, but the page that is supposed to handle the error...
1
by: Brendan Erwin | last post by:
Looking for some clarification here. I'm considering using HttpServerUtility.GetLastError in a standard errorhandler for all my pages. (Inherits System.Web.UI.Page and overrides OnError.) My...
1
by: Dave | last post by:
Hi I want to know if it's possible to user Server.GetLastError() in my AppError.aspx below? The GetLastError is not available here and returns null. I'm using Application_Error event to send an...
1
by: Ganesh Ramamurthy | last post by:
Hi Experts, I am getting the following error when I do a Response.Redirect from an aspx page to another aspx page. I am using the following code in my global.asax Application_Error event to...
1
by: robertlair | last post by:
I am having issues with a production server with the GetLastError() method. Here is what I am doing: Application_Error on Global ASAX: Note: I am doing it this way (with ClearError) because...
1
by: Gummy | last post by:
Hello, I've been banging my head against the wall for a few days on this. When I run a page, either in "View in Browser" or I actually build the solution, I occasionally and very randomly get...
7
by: dhnriverside | last post by:
Hi peeps I'm just following this HOW-TO from MSDN.. http://support.microsoft.com/default.aspx?scid=kb;en-us;306355 But I've got a problem. I've adding the #using System.Diagnostics; line to...
2
by: Vedo | last post by:
The MSDN documentation says that the GetLastError function can give undefined behavior when compiling with /clr:pure switch. Does this statement apply to both C++ interop and P/Invoke? If yes, does...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.