== Why is this an issue?

It is not possible to handle errors that arise inside error-handling code. Therefore, the declaration of a new error handler within an error-handling section will lead to unpredictable behavior, since the second error-handling routine is activated only after the first error handler has exited.


=== Noncompliant code example

[source,vb6]
----
Sub InitializeMatrix(Var1 As Integer, Var2 As Integer, Var3 As Integer, Var4 As Integer)
    On Error GoTo ErrorHandler
    '. . .
    Exit Sub
ErrorHandler:
   On Error GoTo ErrorHandlerLastResort
    '. . .
    Resume Next
ErrorHandlerLastResort:
   '. . .
   Resume Next
End Sub
----


=== Compliant solution

[source,vb6]
----
Sub InitializeMatrix(Var1 As Integer, Var2 As Integer, Var3 As Integer, Var4 As Integer)
    On Error GoTo ErrorHandler
    '. . .
    Exit Sub
ErrorHandler:
    '. . .
    Resume Next
End Sub
----

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Remove this nested error handler


endif::env-github,rspecator-view[]
