Back

VB002

On Error Resume Next

Visual Basic 6
Warning
VB6

It swallows every error after it — the VB6 equivalent of an empty except block

it swallows every error after it — the VB6 equivalent of an empty except block.

Why this severity

it swallows every error after it — the VB6 equivalent of an empty except block.


Known false positives

a tight block that checks Err.Number immediately after each risky call is a legitimate pattern; the rule cannot see the discipline, only the statement.

Remediation example

On Error GoTo Handler
' work
Exit Sub
Handler:
    LogError Err.Number, Err.Description

Reconnecting… Connection lost. Reload