Unhandled on Error Resume Next
Finds instances of 'On Error Resume Next' that don't have a corresponding 'On Error GoTo 0' to restore error handling.
NEW! This inspection is only available in pre-release builds.
Reasoning
'On Error Resume Next' should be constrained to a limited number of instructions, otherwise it supresses error handling for the rest of the procedure; 'On Error GoTo 0' reinstates error handling. This inspection helps treating 'Resume Next' and 'GoTo 0' as a code block (similar to 'With...End With'), essentially.
Default severity
Warning
Inspection type
CodeQualityIssues
Examples
This example should trigger a result
This example should NOT trigger a result
Rubberduck.CodeAnalysis.Inspections.Concrete.UnhandledOnErrorResumeNextInspection.cs (Prerelease-v2.5.2.6174)