ErrorSnapshotter
Index
Methods
__init__
Parameters
optionalkeyword-onlysnapshot_kvs_name: str | None = None
Returns None
capture_snapshot
Parameters
error_message: str
Used in filename of the snapshot.
file_and_line: str
Used in filename of the snapshot.
context: BasicCrawlingContext
Context that is used to get the snapshot.
Returns None
Capture error snapshot and save it to key value store.
It saves the error snapshot directly to a key value store. It can't use
context.get_key_value_storebecause it returnsKeyValueStoreChangeRecordswhich is committed to the key value store only if theRequestHandlerreturned without an exception. ErrorSnapshotter is on the contrary active only whenRequestHandlerfails with an exception.