When you write a error subroutine you are doing two things:
The subroutine error handler will handle the exception and pass control to your subroutine.
You can use the error subroutine to take specific actions based on the error which occurred or you can have a generic action (for example, issuing an inquiry message for all errors).
The following considerations apply to error subroutines:
To see how to code an error subroutine to avoid such a loop, see Avoiding a Loop in an Error Subroutine.