MCPcopy
hub / github.com/scrapy/scrapy / dropped

Method dropped

scrapy/logformatter.py:115–134  ·  view source on GitHub ↗

Logs a message when an item is dropped while it is passing through the item pipeline.

(
        self,
        item: Any,
        exception: BaseException,
        response: Response | Failure | None,
        spider: Spider,
    )

Source from the content-addressed store, hash-verified

113 }
114
115 def dropped(
116 self,
117 item: Any,
118 exception: BaseException,
119 response: Response | Failure | None,
120 spider: Spider,
121 ) -> LogFormatterResult:
122 """Logs a message when an item is dropped while it is passing through the item pipeline."""
123 if (level := getattr(exception, "log_level", None)) is None:
124 level = spider.crawler.settings["DEFAULT_DROPITEM_LOG_LEVEL"]
125 if isinstance(level, str):
126 level = getattr(logging, level)
127 return {
128 "level": level,
129 "msg": DROPPEDMSG,
130 "args": {
131 "exception": exception,
132 "item": item,
133 },
134 }
135
136 def item_error(
137 self,

Callers 1

start_itemproc_asyncMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected