locked
Classic ASP - Not generating specific errors.... RRS feed

  • Question

  • User52593762 posted

    Hi all,

    I am running IIS7 on Vista Home Premium.
    I have the following issue: not all errors in Classic ASP pages (using VBScript) are generating a 500 error. Some generate a 200 status code and stop the page from further executing. I find this very frustrating!

    For example - this works (of course):
    <% Option Explicit %>
    <%
    Dim strResponse

    strResponse=generateString()
    Response.Write(strResponse)

    Function generateString()
     generateString="Hello all!"
    End Function
    %> 

    This should trow an error (because the function generateString2 does not exist):
    <% Option Explicit %>
    <%
    Dim strResponse

    strResponse=generateString2()
    Response.Write(strResponse)

    Function generateString()
     generateString="Hello all!"
    End Function
    %>
    But it DOESN'T!!! The page just stops executing....

    On XP Pro with IIS5 it trows a 500 error (as expected).

    Some Classic ASP errors do trow "normal" error messages. Syntax errors for example:
    <% Response.Write("Hello"); %>
    do show up in the logs and the failed request tracing folder as expected.

    Just for the record: the IIS log file tells me that ther is nothing wrong (status code 200). I have the failed request tracing setup which traces 500 errors. But nothing is there...

    So please help me...
    Is this an IIS settings issue? Or something else?
    What should I do??

    Thanks in advance!

    Johan.

    Sunday, June 15, 2008 8:53 AM

Answers

All replies

  • User1073881637 posted

    By default classic asp doesn't display errors in IIS 7. You have to enable this option.

    http://blogs.iis.net/bills/archive/2007/05/21/tips-for-classic-asp-developers-on-iis7.aspx

    To revert back to IIS6- behavior, simply run the following command:

    %windir%\system32\inetsrv\appcmd set config -section:asp -scriptErrorSentToBrowser:true

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Sunday, June 15, 2008 10:37 PM
  • User52593762 posted

    Hi Dave,

    Thanks for your response. Nice to know that there are people out there who care :)

    Anyway I checked my IIS settings like you suggested, and I already have "Send Errors To Browser" set to "True". Fact is that some errors show up in my browser (like syntax errors) but not all of them (see the code in my original post).

    Any more tips?

    Johan

    Monday, June 16, 2008 8:41 AM
  • User545265881 posted

    if you haven't already done that, uncheck "Show friendly HTTP error messages" in Internet Options > Advanced.

    Tuesday, June 17, 2008 9:40 AM
  • User52593762 posted

    Hi Attiajos,

    That is also already turned on...
    Is it possible that you or anyone else could run my example code and check if the behavior is similar as I reported it?
    If not - then it has to do with my machine. If the behavior is similar then I hope that there is someone out there really smart who could fix this problem.

    Thanks in advance - and looking forward for the results...

    Johan

    Wednesday, June 18, 2008 3:24 AM
  • User545265881 posted

    i will run your code on my machine when i get home from work.

    Wednesday, June 18, 2008 8:56 AM
  • User52593762 posted

    Hi everyone out there!

    Could someone please test the code placed in my original post to see if the behavior is similar?

    Thanks a lot!!!

    Johan.

    Friday, June 20, 2008 10:30 AM
  • User-298957648 posted

    Hello,

     

    I need help with a small issue about a Windows 2008 + IIS7 + ASP.

     

    About the feature in IIS7 > ASP > Compilation > Send Errors to Browser = True

    is done exactly as shown in http://blogs.iis.net/bills/archive/2007/05/21/tips-for-classic-asp-developers-on-iis7.aspx

     

    I created a code in .asp with error Intentionally to see an error... the code are:

    Response.write "OK"
    While not False
    Loop

     

     

    However, a very strange thing is happening.

    Accessing the page .asp in the same server the error is shown the correct (and expected) error like:

    Compilation error from Microsoft VBScript error '800a040e'
    'loop' without 'do'

    default.asp, line 4

    Loop
    ^

    But when the same script is accessed from another location (via browser), the errors are not specific, and is displaying an Dark and light gray page like the following:

     Server Error
    500 - Internal Server error.
    There is a problem with the resource that you are looking for and can´t be shown

     (Sorry, the actual server is installed in Portuguese, so I have to translate the msg error, so, probably is a slightly different from the error in a english installation)

     

     

    Can anyone help me to see why the error locally and remotely is different?
    I need to send the same error locally to another host.

    Thursday, October 16, 2008 9:56 AM
  • User-2026410440 posted

    Try changing your error pages setting.  Go to 'error pages' feature in IIS Manager.  Click on 'Edit Feature Settings' in the right hand pane.  Choose "Detailed Errors'.

     I haven't tested this, but I think it should work.

    Thursday, October 16, 2008 6:47 PM
  • User-298957648 posted

     Bills,

     

    Thank you very much... your msg helped me to solve the issue.

     

    Best Regards

    Fernando

    Friday, October 17, 2008 9:53 AM