in reply to A question on defined loop

Please show a self-contained example that exhibits the problem.  In this revised sample, it's not clear how and where you're calling error_excerpt()...

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.