MCPcopy
hub / github.com/scrapy/scrapy / failure_to_exc_info

Function failure_to_exc_info

scrapy/utils/log.py:28–40  ·  view source on GitHub ↗

Extract exc_info from Failure instances

(
    failure: Failure,
)

Source from the content-addressed store, hash-verified

26
27
28def failure_to_exc_info(
29 failure: Failure,
30) -> tuple[type[BaseException], BaseException, TracebackType | None] | None:
31 """Extract exc_info from Failure instances"""
32 if isinstance(failure, Failure):
33 assert failure.type
34 assert failure.value
35 return (
36 failure.type,
37 failure.value,
38 cast("TracebackType | None", failure.getTracebackObject()),
39 )
40 return None
41
42
43class TopLevelFormatter(logging.Filter):

Callers 10

logerrorFunction · 0.90
handle_exceptionMethod · 0.90
_scrapeMethod · 0.90
handle_spider_errorMethod · 0.90
media_to_downloadMethod · 0.90
item_completedMethod · 0.90
test_failureMethod · 0.90
test_non_failureMethod · 0.90

Calls

no outgoing calls

Tested by 3

test_failureMethod · 0.72
test_non_failureMethod · 0.72