mirror of https://github.com/scrapy/scrapy.git
Merge pull request #724 from rafallo/master
item_dropped signal should pass response arg as item_scraped does
This commit is contained in:
commit
8a1c67fdaa
|
|
@ -83,7 +83,7 @@ item_dropped
|
|||
------------
|
||||
|
||||
.. signal:: item_dropped
|
||||
.. function:: item_dropped(item, exception, spider)
|
||||
.. function:: item_dropped(item, response, exception, spider)
|
||||
|
||||
Sent after an item has been dropped from the :ref:`topics-item-pipeline`
|
||||
when some stage raised a :exc:`~scrapy.exceptions.DropItem` exception.
|
||||
|
|
@ -96,6 +96,9 @@ item_dropped
|
|||
:param spider: the spider which scraped the item
|
||||
:type spider: :class:`~scrapy.spider.Spider` object
|
||||
|
||||
:param response: the response from where the item was dropped
|
||||
:type response: :class:`~scrapy.http.Response` object
|
||||
|
||||
:param exception: the exception (which must be a
|
||||
:exc:`~scrapy.exceptions.DropItem` subclass) which caused the item
|
||||
to be dropped
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ class Scraper(object):
|
|||
logkws = self.logformatter.dropped(item, ex, response, spider)
|
||||
log.msg(spider=spider, **logkws)
|
||||
return self.signals.send_catch_log_deferred(signal=signals.item_dropped, \
|
||||
item=item, spider=spider, exception=output.value)
|
||||
item=item, response=response, spider=spider, exception=output.value)
|
||||
else:
|
||||
log.err(output, 'Error processing %s' % item, spider=spider)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue