all groups > inetserver asp general > september 2005 >
You're in the

inetserver asp general

group:

How to log ASP-error codes?



How to log ASP-error codes? Michael Bender
9/29/2005 6:39:26 PM
inetserver asp general: Hi everybody,

I would like to write ASP error codes in a log file. Error message would be
for example:

ADODB.Fields error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name
or ordinal.
/ASP-application/page1.asp, line 67

I've learned that it is possible to get some information with the
'err-object' of VB. Unfortunately these codes and descriptions are not that
good as the ones ASP itself generates. First of all I'm interested in the
description ("Item cannot be found in..") and the line in the ASP-Page where
the error occurs.

Does anybody know how to catch this information?

Thx and best regards
Michael

Re: How to log ASP-error codes? Phill. W
9/30/2005 12:15:18 PM
[quoted text, click to view]

In what way?

[quoted text, click to view]

If you trap this error,
Err.Number = 0x800a0cc1,
Err.Description = "Item cannot be found ..."

What you /won't/ get is the executing page and line number.
The first you can retrieve from

Request.ServerVaraibles( "Script_Name" )

the latter you can't easily get hold of without doctoring your code
with physical line numbers. Personally, I prefer to record the name
of the failing /function/ rather than just an arbitrary line number.

HTH,
Phill W.

AddThis Social Bookmark Button