On Local Error

Flags obsolete 'On Local Error' statements.

 NEW! This inspection is only available in pre-release builds.

Reasoning

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

Default severity

Suggestion

Inspection type

LanguageOpportunities

QuickFixes

The following quickfixes are available for this inspection:

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.2.6174)