mirror of https://github.com/scrapy/scrapy.git
Docs: clarify the handling of exceptions raised in errbacks (#7898)
This commit is contained in:
parent
63d5ce6272
commit
7c797968a3
|
|
@ -770,6 +770,10 @@ is raise while processing it.
|
|||
It receives a :exc:`~twisted.python.failure.Failure` as first parameter and can
|
||||
be used to track connection establishment timeouts, DNS errors etc.
|
||||
|
||||
If an errback raises an exception, Scrapy logs it and sends the
|
||||
:signal:`spider_error` signal, unless the exception is the one that the errback
|
||||
received, which Scrapy logs as a download error instead.
|
||||
|
||||
Here's an example spider logging all errors and catching some specific
|
||||
errors if needed:
|
||||
|
||||
|
|
|
|||
|
|
@ -145,8 +145,9 @@ one or more of these methods:
|
|||
|
||||
.. method:: process_spider_exception(response, exception)
|
||||
|
||||
This method is called when a spider or :meth:`process_spider_output`
|
||||
method (from a previous spider middleware) raises an exception.
|
||||
This method is called when a spider callback or a
|
||||
:meth:`process_spider_output` method (from a previous spider
|
||||
middleware) raises an exception.
|
||||
|
||||
:meth:`process_spider_exception` should return either ``None`` or an
|
||||
iterable of :class:`~scrapy.Request` or :ref:`item <topics-items>`
|
||||
|
|
|
|||
Loading…
Reference in New Issue