def iter_errback(iterable, errback, *a, **kw):
    """Wraps an iterable calling an errback if an error is caught while
    iterating it.
    """
    it = iter(iterable)
    while 1:
        try:
            yield next(it)
        except __HOLE__:
            break
        except:
            errback(failure.Failure(), *a, **kw)
dataset/ETHPy150Open wcong/ants/ants/utils/defer.py/iter_errback