Skip to content

Commit

Permalink
add response arg to item_dropped signal handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafal Jagoda committed May 2, 2014
1 parent 197e360 commit 9d226e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs/topics/signals.rst
Expand Up @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scrapy/core/scraper.py
Expand Up @@ -205,7 +205,7 @@ def _itemproc_finished(self, output, item, response, spider):
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:
Expand Down

0 comments on commit 9d226e6

Please sign in to comment.