add response arg to item_dropped signal handlers

#710
This commit is contained in:
Rafal Jagoda 2014-05-02 14:42:01 +01:00
parent 197e360730
commit 9d226e6266
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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: