Vb6 Error Handling

Applies the CSEH (Code Style for Error Handler) pattern when adding or editing error handling in Visual Basic 6 procedures. Covers the structured On Error GoTo template with EhHeader/EhFooter regions, two CSEH styles (ErrRaise for utility functions that propagate to callers, and MsgBox for top-level UI procedures), line numbering (starting at 100, increments of 5) to enable Erl in error handlers, the rule that Err.Number/Err.Description must be captured into local variables as the first statements of the handler because any executed statement (cleanup, ExitMethod, object teardown, or any procedure call) resets the Err object to 0/empty, structured re-raise via Err.Raise that preserves the original Err.Number when propagating a caught error (reserving vbObjectError offset for errors the procedure originates itself) with a qualified source string in App.Module.Procedure format, error message format including Err.Number, Err.Description and Erl, cleanup-before-raise discipline, and the legitimate use of On Error

alexcassol ca70c78 2 files · 17.9 KB Updated

File contents

alexcassol/claude-vb6-skills/tree/main/skills/vb6-error-handling commit ca70c78706

Frequently asked questions

npx skillmds@latest add alexcassol/vb6-error-handling