Err object VS. GetLastError()

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Nick Messick (nmessick_at_gmail.com)
Date: 11/25/04


Date: 24 Nov 2004 16:11:56 -0800

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.



Relevant Pages

  • Re: Err object VS. GetLastError()
    ... GetLastError can *only* be used within the custom 500 error handler, ... I copied one that used the Err object but I don't want to use ... > I then copied our custom 500 error page that uses the GetLastError ...
    (microsoft.public.inetserver.asp.general)
  • Re: CreateDirectory fails but GetLastError says succeeded
    ... getLastError, it has already called additional APIs. ... This is to support the Err object. ... > Private Declare Function GetLastError Lib "kernel32" As Long ... > ByVal lpBuffer As String, ByVal nSize As Long, Arguments As Long) As Long ...
    (microsoft.public.vb.winapi)