test: fix error in test

the error handler should not be called when an error is thrown *within* the error handler