ASP script error trapping

Results 1 to 2 of 2

Thread: ASP script error trapping

  1. #1
    Join Date
    Dec 1969

    Default ASP script error trapping

    I am sure this is going to be laughed at, but I am trying to trap ASP errors (not database-related) but my server seems to be ignoring the On Error Resume Next line.<BR><BR>Example code:<BR><BR>&#060;%<BR><BR>On Error Resume Next<BR><BR>&#039; error<BR>i / 0<BR><BR>If Err.Number &#060;&#062; 0 Then Response.Write Err.Number<BR><BR>&#039; rest of page here<BR><BR>%&#062;<BR><BR>Am I missing the point here? Is there some kind of IIS setting I need to adjust to ensure that the page continues to load and does not display the error detail unles specifically requested?

  2. #2
    Join Date
    Dec 1969

    Default This should work..

    On Error Resume Next<BR><BR>x = 1 / 0<BR><BR>If Err.Number &#060;&#062; 0 Then<BR> Response.Write "Error! " & Err.Number & ". " & Err.Description<BR> Response.End<BR>End If<BR><BR>Response.Write "No Errors Occurred."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts