View Complete Thread
  • Re: Response.Flush breaks IIS's "Custom Errors"

    Apr 18, 2019 08:15 PM|fredericDelaporte|LINK

     @renniqer, The question here is about Classic Asp. Your answer is for Asp.Net, it does not apply.

    Otherwise, the best I have found for handling this case it to put all the rendering in a Render sub, and use

    On Error Resume Next


    If Err.number <> 0 Then

        ' Handle the error
        Response.Write "Error"
    End If

    When an error occur in the render, the render sub is immediately interrupted and you can handle the error with whatever custom code you wish, including coming from an include. So that is no more a catch all solution put only in one place, but for pages requiring that flush trick, well, just use one more trick for handling their errors.