Previous Next

Thread: Classic ASP - Not generating specific errors....

Last post 10-17-2008 9:53 AM by fbraghetto. 9 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (10 items)

Sort Posts:

  • 06-15-2008, 8:53 AM

    Classic ASP - Not generating specific errors....

    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.

  • 06-15-2008, 10:37 PM In reply to

    Re: Classic ASP - Not generating specific errors....

    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

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield

    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 06-16-2008, 8:41 AM In reply to

    Re: Classic ASP - Not generating specific errors....

    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

  • 06-17-2008, 9:40 AM In reply to

    • attiajos
    • Not Ranked
    • Joined on 06-17-2008, 1:31 PM
    • Posts 3

    Re: Classic ASP - Not generating specific errors....

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

  • 06-18-2008, 3:24 AM In reply to

    Re: Classic ASP - Not generating specific errors....

    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

  • 06-18-2008, 8:56 AM In reply to

    • attiajos
    • Not Ranked
    • Joined on 06-17-2008, 1:31 PM
    • Posts 3

    Re: Classic ASP - Not generating specific errors....

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

  • 06-20-2008, 10:30 AM In reply to

    Re: Classic ASP - Not generating specific errors....

    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.

  • 10-16-2008, 9:56 AM In reply to

    • fbraghetto
    • Not Ranked
    • Joined on 10-16-2008, 9:29 AM
    • IT Manager
    • Posts 4

    Re: Classic ASP - Not generating specific errors....

    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.

    ------------
    Fernando Braghetto

    "Vacum ad brejum mobilet"
  • 10-16-2008, 6:47 PM In reply to

    • bills
    • Top 25 Contributor
    • Joined on 02-03-2006, 5:33 PM
    • Redmond, WA
    • Posts 430

    Re: Classic ASP - Not generating specific errors....

    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.

    ~~~~~~~~~~~~~~~~~~~~~~~~
    Bill Staples
    Product Unit Manager, IIS
    blog: http://blogs.iis.net/bills
  • 10-17-2008, 9:53 AM In reply to

    • fbraghetto
    • Not Ranked
    • Joined on 10-16-2008, 9:29 AM
    • IT Manager
    • Posts 4

    Re: Classic ASP - Not generating specific errors....

     Bills,

     

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

     

    Best Regards

    Fernando

    ------------
    Fernando Braghetto

    "Vacum ad brejum mobilet"
Page 1 of 1 (10 items)
Page view counter