bug #4634 Error reporting creates an infinite loop

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>