How to log ASP-error codes?

Discussion in 'ASP General' started by Michael Bender, Sep 29, 2005.

  1. 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
     
    Michael Bender, Sep 29, 2005
    #1
    1. Advertising

  2. Michael Bender

    Phill. W Guest

    "Michael Bender" <> wrote in message
    news:dhh599$1io$02$-online.com...
    > I would like to write ASP error codes in a log file.

    .. . .
    > 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.


    In what way?

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


    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.
     
    Phill. W, Sep 30, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henrik_the_boss
    Replies:
    0
    Views:
    2,698
    Henrik_the_boss
    Nov 5, 2003
  2. Greg  --
    Replies:
    4
    Views:
    2,248
  3. Replies:
    2
    Views:
    2,940
    Malcolm
    Aug 20, 2005
  4. Allen
    Replies:
    1
    Views:
    676
    Mark Rae [MVP]
    Dec 3, 2007
  5. Tom Wingert
    Replies:
    0
    Views:
    367
    Tom Wingert
    Jan 12, 2006
Loading...

Share This Page