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_store
because it returnsKeyValueStoreChangeRecords
which is commited to the key value store only if theRequestHandler
returned without an exception. ErrorSnapshotter is on the contrary active only whenRequestHandler
fails with an exception.