Replace Obsolete Error Statement Quick Fix

Replaces the obsolete 'Error' statement with an 'ErrObject.Raise' member call.

This quick-fix is available for the ObsoleteErrorSyntax inspection

Applicability

This quick-fix can be applied as a single operation at the following scopes:
  • Procedure
  • Module
  • Project

Examples

 This example depicts the state of module(s) before and after applying the quick-fix.

Before
Module1 (Any)
Option Explicit Public Sub DoSomething() Error 5 End Sub
After
Module1 (Any)
Option Explicit Public Sub DoSomething() Err.Raise 5 End Sub

Rubberduck.CodeAnalysis.QuickFixes.Concrete.ReplaceObsoleteErrorStatementQuickFix.cs (Prerelease-v2.5.2.6174)