More generic exception handling in log iterator