Classic ASP : Capture Errors

后端 未结 4 1910
深忆病人
深忆病人 2020-12-28 23:12

Is it possible to capture all 500 errors in Classic ASP at a global level? Maybe something in IIS. I\'m using II6 at the moment. I like to capture the error message and th

4条回答
  •  暖寄归人
    2020-12-28 23:48

    Error handling in classic ASP is a complete pain. You can catch the error where you think it's going to occur using on error resume next, then check for the error code in the following line of code.

    Alternately you can scan the server logs for 500 errors. or set up a "500 error" page in your IIS settings.

    On Error Resume Next
    ... do something...
    If Err.Number <> 0 Then
    ... handle error
    end if
    

提交回复
热议问题