MCPcopy
hub / github.com/scrapy/scrapy / download_error

Method download_error

scrapy/logformatter.py:171–191  ·  view source on GitHub ↗

Logs a download error message from a spider (typically coming from the engine).

(
        self,
        failure: Failure,
        request: Request,
        spider: Spider,
        errmsg: str | None = None,
    )

Source from the content-addressed store, hash-verified

169 }
170
171 def download_error(
172 self,
173 failure: Failure,
174 request: Request,
175 spider: Spider,
176 errmsg: str | None = None,
177 ) -> LogFormatterResult:
178 """Logs a download error message from a spider (typically coming from
179 the engine).
180 """
181 args: dict[str, Any] = {"request": request}
182 if errmsg:
183 msg = DOWNLOADERRORMSG_LONG
184 args["errmsg"] = errmsg
185 else:
186 msg = DOWNLOADERRORMSG_SHORT
187 return {
188 "level": logging.ERROR,
189 "msg": msg,
190 "args": args,
191 }
192
193 @classmethod
194 def from_crawler(cls, crawler: Crawler) -> Self:

Callers 3

_scrapeMethod · 0.80

Calls

no outgoing calls

Tested by 2