1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-25 22:43:57 +00:00

Catch start_requests iterator errors. refs #83

This commit is contained in:
Daniel Graña 2012-01-27 17:41:38 -02:00
parent 7201d074c1
commit 2e18f0db33

View File

@ -106,9 +106,13 @@ class ExecutionEngine(object):
if slot.start_requests and not self._needs_backout(spider):
try:
request = slot.start_requests.next()
self.crawl(request, spider)
except StopIteration:
slot.start_requests = None
except Exception, exc:
log.err(None, 'Obtaining request from start requests', \
spider=spider)
else:
self.crawl(request, spider)
if self.spider_is_idle(spider) and slot.close_if_idle:
self._spider_idle(spider)