Catch StopIteration specifically