Error Handling occurs only once

Now this is weird, I have an agent in script that goes through a lot of databases and does changes the server on which to run on the agents. Because some databases don’t have agents (which crashed the agent) and some databases we don’t have access, we put and error handling thing so that if an error happens during the processing of a database, we skip to the next.

For some reason we cannot understand, the error handling happpens correctly for the first error, but the second time, the On Error does not execute and the agent just crashes on the line where the error occurs and returns the “Variable not set” error…

Why would the On Error occur once, but not for all errors? Anyone have a theory?

Subject: Error Handling occurs only once

Two possibilities are

Your error handling is catching a specific error which is not the error that is causing the code to fail.

or

You don’t have a Resume statement in your error handling code.

You could take a copy of the agent, set it to run manually from the actions menu and run it through in the debugger to see what is happening.

Subject: RE: Error Handling occurs only once

Doh ! I feel like a junior, forgot the resume, thanks !