[thelist] ASP Error Reporting

Chris Marsh chris at ecleanuk.com
Mon Mar 24 08:24:29 CST 2003


[..]

> > 4) Has anyone ever done anything similar?
> 
> Yes.  I work on a large commercial site and every server 
> error generates an email to the site administrator (I am 
> registered as the admin on my test
> site) with all relevant details.  We also have a server log 
> of program activity which helps too, but the emails are invaluable.

Thanks for the response. However, I'm having more problems than I
anticipated. I haven't used the ASPError object extensively, so I did a
bit of research and thought I'd put together an ASP page to test the
theory. I looked at http://www.w3schools.com/asp/asp_ref_error.asp and
http://www.asphole.com/StoriesRead.ASP?ID=31, which seem to be
essentially the same. When I try to run either of them, I get no change
to the normal error page.

http://64.239.84.225/test2.asp is the test page on my server, and the
following is the code. Can anyone punt me in the right direction?

<html>
<body>

<%
'The following line creates an error
dim i for i=1 to 1 next

'Call the GetLastError() method to trap the error
dim objerr
set objerr=Server.GetLastError()

'The variable objerr now contains the ASPError object
response.write("ASP Code=" & objerr.ASPCode)
response.write("<br />")
response.write("Number=" & objerr.Number)
response.write("<br />")
response.write("Source=" & objerr.Source)
response.write("<br />")
response.write("Filename=" & objerr.File)
response.write("<br />")
response.write("LineNumber=" & objerr.Line)
%></body>
</html>

Muchos gracias...

Regards

Chris Marsh

"It's much more interesting to live not knowing than to have answers
that might be wrong."    - Richard Feynman



More information about the thelist mailing list