On Local Error

Flags obsolete 'On Local Error' statements.

Reasoning

All errors are "local" - the keyword is redundant/confusing and should be removed.

Default severity

Suggestion

Inspection type

LanguageOpportunities

Examples

This example should trigger a result

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

This example should NOT trigger a result

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

Rubberduck.CodeAnalysis.Inspections.Concrete.OnLocalErrorInspection.cs (Prerelease-v2.5.9.6289)