Obsolete Error Syntax

Locates legacy 'Error' statements.

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

Reasoning

The legacy syntax is obsolete; prefer 'Err.Raise' instead.

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() Error 5 ' raises run-time error 5 End Sub

This example should NOT trigger a result

MyModule (StandardModule)
Public Sub DoSomething() Err.Raise 5 ' raises run-time error 5 End Sub

Rubberduck.CodeAnalysis.Inspections.Concrete.ObsoleteErrorSyntaxInspection.cs (Prerelease-v2.5.2.6174)