05-06-2002, 07:09 AM
Does anyone know how to trap errors using ASP? I'm awhere of "Transactions", but is there another way that ASP can trap Database errors or Run Time errors, etc? For example, if an error happens within a section of a page to display a generic message or do something else. Any help or direction to find help would be appreciated.
05-06-2002, 08:09 AM
Well, you can use "On Error Resume Next" and then check the current values of objects and such to see if an error has occured and then display content as appropriate.
"On Error GoTo ErrorTrap" is not allowed in ASP scripts.
Alternatively, you can simulate the "goto" error trapping capabilities with:
Use this page as a great reference:
05-06-2002, 08:10 AM
On Error Resume Next
If Err Then
Response.Write "<P>" & Err.Number & " " & Err.Description & "</P>"