Rob Allen wites in his DevNotes; If you have a Zend Framework Front Controller plugin which throws an exception, then the action is still executed and then the error action is then called, so that the displayed output shows two actions rendered, with two layouts also rendered. This is almost certainly not what you want or what you expected.

This is how to handle errors in a Front Controller plugin:

Prefer preDispatch() over dispatchLoopStartup() as it is called from within the dispatch loop

Catch the exception and the modify the request so that the error controller’s error action is dispatched.

Create an error handler object so that the error action works as expected.