Empty Err Number

Discussion in 'ASP General' started by ionpopescu, Jun 15, 2005.

  1. ionpopescu

    ionpopescu Guest

    I have this code in an ASP class:

    If Err.Number <> 0 then
    'error handling here...
    End If

    The code worked just fine. Now, when I debug, Err.Number and
    Err.Description are empty, so, of course, as Err.number is no longer 0,
    the error handling part gets executed, aborting the normal execution
    even though there's no actual error in my code.

    I have googled it, but the only hint I found is that this happens if
    you do a "Dim Err" in your code. I haven't.

    Does anybody have any idea why the Err object behaves this way, and is
    there a workaround so that I do not have to change every "If Err.Number
    <> 0" in my code?

    Thanks,
    Doru
    ionpopescu, Jun 15, 2005
    #1
    1. Advertising

  2. ionpopescu

    Guest

    Did you Use "On error resume next" or "Err.Clear" above that If in your
    code?
    , Jun 15, 2005
    #2
    1. Advertising

  3. ionpopescu wrote:
    > I have this code in an ASP class:
    >
    > If Err.Number <> 0 then
    > 'error handling here...
    > End If
    >
    > The code worked just fine. Now, when I debug, Err.Number and
    > Err.Description are empty, so, of course, as Err.number is no longer
    > 0, the error handling part gets executed, aborting the normal
    > execution even though there's no actual error in my code.
    >
    > I have googled it, but the only hint I found is that this happens if
    > you do a "Dim Err" in your code. I haven't.
    >
    > Does anybody have any idea why the Err object behaves this way, and is
    > there a workaround so that I do not have to change every "If
    > Err.Number <> 0" in my code?
    >
    > Thanks,
    > Doru


    This only happens when you debug? What are you using to debug?

    --
    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], Jun 16, 2005
    #3
    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.

Share This Page