Inspection Details

OnLocalError


Summary
Flags obsolete 'On Local Error' statements.
Reasoning
All errors are "local" - the keyword is redundant/confusing and should be removed.
The following code example(s) would trigger this inspection:

Public Sub DoSomething()
    On Local Error GoTo ErrHandler
    ' ...
    Exit Sub
    ErrHandler:
    ' ...
End Sub

The following code example(s) would not trigger this inspection:

Public Sub DoSomething()
    On Error GoTo ErrHandler
    ' ...
    Exit Sub
    ErrHandler:
    ' ...
End Sub


Back to List