← Back to Session, State, and Security
Lesson 4

Error Handling with Err Object

Session, State, and Security · Created 2026-06-01 13:34:28

ASPPY supports Classic ASP error handling.

Err Object Members
Err.Number - error code (0 = no error)
Err.Description - error message
Err.Clear() - reset error state
Err.Raise(n) - simulate an error

On Error Resume Next
On Error Resume Next
conn.Execute someSQL
If Err.Number <> 0 Then
Response.Write 'Error: ' & Err.Description
Err.Clear : End If

ASPPY Specifics
On Error Resume Next works as expected
Avoid On Error GoTo 0 (causes compilation issues)
Use Err.Clear instead of On Error GoTo 0

Live Demo →