def iter_errback(iterable, errback, *a, **kw):
 it = iter(iterable)
 while 1:
  try:
   (yield it.next())
  except StopIteration:
   break
  except:
   errback(failure.Failure(), *a, **kw)

def iter_errback ( iterable , errback , * a , ** kw ) : it = iter ( iterable ) while 1 : try : ( yield it . next ( ) ) except StopIteration : break except : errback ( failure . Failure ( ) , * a , ** kw )
wraps an iterable calling an errback if an error is caught while iterating it .