errorhandling inc-files

Discussion in 'ASP General' started by Passero, Jul 14, 2005.

  1. Passero

    Passero Guest

    I have a rather big project written in ASP 3.0. It has more dan 200
    pages and i have 4 inc-files with general functions that are used in
    almost al the pages.
    When an error occures, i get a mail with the description, file were the
    error did occur but the problem is that when the error occures in the
    inc file i get the name of the inc file as page. This is rather
    difficult because i want to know where the error occured in the ASP
    page. Is this possible or how can i get the name of that ASP page. Some
    sort of a stack trace. It would be great if i also can get the number
    where the function is called in the inc file but i don't think that
    would be possible.
    Passero, Jul 14, 2005
    #1
    1. Advertising

  2. Passero wrote:
    > I have a rather big project written in ASP 3.0. It has more dan 200
    > pages and i have 4 inc-files with general functions that are used in
    > almost al the pages.
    > When an error occures, i get a mail with the description, file were
    > the error did occur but the problem is that when the error occures in
    > the inc file i get the name of the inc file as page. This is rather
    > difficult because i want to know where the error occured in the ASP
    > page. Is this possible or how can i get the name of that ASP page.
    > Some sort of a stack trace. It would be great if i also can get the
    > number where the function is called in the inc file but i don't think
    > that would be possible.


    This is not possible without modifying each of the 200 pages that call the
    functions in the inlude files - sorry.

    You will need to put some error-handlers in your pages. This can be as
    simple as
    on error resume next
    call function_in_inc_file()
    if err <> 0 then
    HandleError err
    end if

    or, you can make it a little more useful by doing something like this:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;299981
    or this:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;299986
    or this:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;288965


    HTH,
    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jul 14, 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. niz
    Replies:
    2
    Views:
    1,913
    Simon Andrews
    Jul 23, 2003
  2. Roel
    Replies:
    4
    Views:
    1,658
  3. VSK
    Replies:
    0
    Views:
    115
  4. Jennifer
    Replies:
    1
    Views:
    156
    Tad McClellan
    Jun 24, 2003
  5. Replies:
    3
    Views:
    1,589
Loading...

Share This Page