From 2859b7697bd2b7511c837364931b3ccfb7ab5b0b Mon Sep 17 00:00:00 2001 From: Adrian Chaves Date: Thu, 6 Aug 2026 06:43:51 +0200 Subject: [PATCH] Clarify that Scrapy sets Failure.request --- docs/topics/request-response.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/topics/request-response.rst b/docs/topics/request-response.rst index 75158440b..828b7539f 100644 --- a/docs/topics/request-response.rst +++ b/docs/topics/request-response.rst @@ -765,11 +765,15 @@ Errbacks ======== The errback of a request is a function that will be called when an exception -is raise while processing it. +is raised 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. +Scrapy sets the ``request`` attribute of that +:exc:`~twisted.python.failure.Failure` object to the :class:`~scrapy.Request` +object being processed. + Here's an example spider logging all errors and catching some specific errors if needed: